Class StandardRobotsTxtProvider
java.lang.Object
com.norconex.crawler.core.event.listeners.CrawlerLifeCycleListener
com.norconex.crawler.web.doc.operations.robot.impl.StandardRobotsTxtProvider
- All Implemented Interfaces:
EventListener<Event>,RobotsTxtProvider,EventListener,Consumer<Event>
public class StandardRobotsTxtProvider
extends CrawlerLifeCycleListener
implements RobotsTxtProvider
Implementation of RobotsTxtProvider as per the robots.txt standard
described at
http://www.robotstxt.org/robotstxt.html.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleangetRobotsTxt(Fetcher fetcher, String url) Gets robots.txt rules.inthashCode()protected voidonCrawlerCrawlBegin(CrawlerEvent event) protected RobotsTxtparseRobotsTxt(InputStream is, String url, String userAgent) toString()Methods inherited from class com.norconex.crawler.core.event.listeners.CrawlerLifeCycleListener
accept, onCrawlerCleanBegin, onCrawlerCleanEnd, onCrawlerCrawlEnd, onCrawlerError, onCrawlerEvent, onCrawlerStopBegin, onCrawlerStopEnd
-
Constructor Details
-
StandardRobotsTxtProvider
public StandardRobotsTxtProvider()
-
-
Method Details
-
onCrawlerCrawlBegin
- Overrides:
onCrawlerCrawlBeginin classCrawlerLifeCycleListener
-
getRobotsTxt
Description copied from interface:RobotsTxtProviderGets robots.txt rules. This method signature changed in 1.3 to include the userAgent.- Specified by:
getRobotsTxtin interfaceRobotsTxtProvider- Parameters:
fetcher- http fetcher executor to grab robots.txturl- the URL to derive the robots.txt from- Returns:
- robots.txt rules
-
parseRobotsTxt
- Throws:
IOException
-
equals
- Overrides:
equalsin classCrawlerLifeCycleListener
-
canEqual
- Overrides:
canEqualin classCrawlerLifeCycleListener
-
hashCode
public int hashCode()- Overrides:
hashCodein classCrawlerLifeCycleListener
-
toString
- Overrides:
toStringin classCrawlerLifeCycleListener
-