if (protocol.isAllowed(uri)) {
if (LOG.isInfoEnabled()) {
LOG.info("Loading " + uri);
}
ManagedContentEntity entity = null;
try {
entity = protocol.load(uri);
} catch(OutOfMemoryError e) {
LOG.error("Out of memory processing: " + uri + " skipping", e);
throw new DroidsException(e);
}
try {
String contentType = entity.getMimeType();
if (LOG.isDebugEnabled()) {
LOG.debug("Content type " + contentType);
}
if (contentType == null){
LOG.info("Missing content type... can't parse...");
}
else {
Parser parser = droid.getParserFactory().getParser(contentType);
if( parser == null ) {
if (LOG.isDebugEnabled()) {
LOG.debug("Could not find parser for " + contentType);
}
}
else {
Parse parse = parser.parse(entity, link);
if( parse.getNewTasks() != null && parse.isFollowed() ) {
Collection<Link> outlinks = getFilteredOutlinks( parse );
droid.getQueue().addAll( outlinks );
}
entity.setParse(parse);
handle(entity, link);
}
}
} finally {
entity.finish();
}
}
else {
if (LOG.isInfoEnabled()) {
LOG.info("Stopping processing since"