public boolean download() throws FileNotFoundException {
        Queue<String> needVisitPageSet = new LinkedList<String>();
        Set<String> visitedPageSet = new HashSet<String>();

        String ref = getValidRef(root, root);

        needVisitPageSet.add(ref);
        visitedPageSet.add(ref);


        while (!needVisitPageSet.isEmpty()) {
            ref = needVisitPageSet.remove();

            logger.info("[DOWNLOAD] (" + needVisitPageSet.size() + "/" + visitedPageSet.size() + "): " + ref);
            String page;
            try {
                URL pageUrl = new URL(ref);
                page = downloadPage(pageUrl);
                if (page.length() < 10) {
                    throw new IOException("Small content");
                }
                savePageToFile(pageUrl, page);
            } catch (IOException e) {
                logger.debug("[SKIP] (ERROR during download): " + ref);
                continue;
            }

            Matcher matcher = pattern.matcher(page);

            while (matcher.find()) {
                String obtainedRef = matcher.group(1);

                obtainedRef = getValidRef(obtainedRef, ref);

                if (obtainedRef != null) {

                    if (visitedPageSet.add(obtainedRef)) {
                        logger.info("[FIND] " + obtainedRef);
                        needVisitPageSet.add(obtainedRef);
                    }
                }
            }
        }

        return true;
    }