try {
if (!spider.isRunning()) {
return;
}
spider.fireParsingStarted(resource.getURI());
ContentHandler contentHandler = getContentHandler();
if (contentHandler == null) {
logger.warning(resource.getMimeType() + " content not handled.");
return;
}
contentHandler.handle();
String[] pageLinks = contentHandler.getPageLinks();
for (int i = 0; i < pageLinks.length; i++) {
String link = pageLinks[i];
spider.retrieve(link, LinkFilter.EXTERNAL_LINK, resource.getLevel() + 1, resource.getURI());
}
String[] imageLinks = contentHandler.getImageLinks();
for (int i = 0; i < imageLinks.length; i++) {
String image = imageLinks[i];
spider.retrieve(image, LinkFilter.EMBEDDED_IMAGE_LINK, resource.getLevel(), resource.getURI());
}
} catch (HandlingException e) {