org.apache.droids.norobots.package.html Maven / Gradle / Ivy
Using norobots-rfc
- Import the class
import org.apache.http.norobots.NoRobotClient;
- Create an instance for your user-agent
NoRobotClient nrc = NoRobotClient("googlebot");
- Parse a robots.txt at a site
nrc.parse( new URL( "http://www.apache.org/" ) );
- Ask if a url is allowed
boolean test = nrc.isUrlAllowed( new URL( "http://www.apache.org/index.html" ) );