RobotsTXTErrorRule.java
上传用户:qing5858
上传日期:2015-10-27
资源大小:6056k
文件大小:1k
源码类别:

搜索引擎

开发平台:

Java

  1. package net.javacoding.jspider.core.rule.impl;
  2. import net.javacoding.jspider.api.model.Decision;
  3. import net.javacoding.jspider.api.model.Site;
  4. import net.javacoding.jspider.core.SpiderContext;
  5. import net.javacoding.jspider.core.model.DecisionInternal;
  6. import java.net.URL;
  7. /**
  8.  * $Id: RobotsTXTErrorRule.java,v 1.2 2003/04/03 15:57:16 vanrogu Exp $
  9.  */
  10. public class RobotsTXTErrorRule extends BaseRuleImpl {
  11.     /**
  12.      * Applies the rule to the given url.
  13.      * @param context the context we're spidering under
  14.      * @param currentSite the site we're currently spidering
  15.      * @param url the url to be evaluated
  16.      * @return Decision object telling whether the url should be accepted.
  17.      * This implementation always returns a reject decision.
  18.      */
  19.     public Decision apply(SpiderContext context, Site currentSite, URL url) {
  20.         return new DecisionInternal(Decision.RULE_IGNORE, "robots.txt fetch resulted in an error - all resources in site are ignored");
  21.     }
  22. }