} catch (URISyntaxException ex) {
log.error("Unable to determine base URI for " + uri);
return false;
}
NoRobotClient nrc = new NoRobotClient(contentLoader, userAgent);
try {
nrc.parse(baseURI);
} catch (NoRobotException ex) {
log.error("Failure parsing robots.txt: " + ex.getMessage());
return false;
}
boolean test = nrc.isUrlAllowed(uri);
if (log.isInfoEnabled()) {
log.info(uri + " is " + (test ? "allowed" : "denied"));
}
return test;
}