logger.log(Level.INFO, "Skipping “" + nextPage + "”.");
continue;
}
- URLFetcher urlFetcher;
+ final URLFetcher urlFetcher;
try {
logger.log(Level.INFO, "Fetching “" + nextURL + "”...");
urlFetcher = new URLFetcher(parserFactory, nextURL);
- urlFetcherExecutor.execute(urlFetcher);
+ urlFetcherExecutor.execute(new Runnable() {
+
+ public void run() {
+ urlFetcher.run();
+ for (Page page : urlFetcher.getCollectedPages()) {
+ addPage(page);
+ }
+ }
+ });
} catch (NoSuchAlgorithmException nsae1) {
logger.log(Level.SEVERE, "Could not get “SHA-256” message digest!", nsae1);
}