KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > javacoding > jspider > mod > rule > RejectAllRule


1 package net.javacoding.jspider.mod.rule;
2
3 import net.javacoding.jspider.api.model.Decision;
4 import net.javacoding.jspider.api.model.Site;
5 import net.javacoding.jspider.core.SpiderContext;
6 import net.javacoding.jspider.core.rule.impl.BaseRuleImpl;
7 import net.javacoding.jspider.core.model.DecisionInternal;
8
9 import java.net.URL JavaDoc;
10
11 /**
12  * Implementation of a Rule that rejects all urls.
13  *
14  * $Id: RejectAllRule.java,v 1.1 2003/04/03 16:10:52 vanrogu Exp $
15  *
16  * @author Günther Van Roey ( gunther@javacoding.net )
17  */

18 public class RejectAllRule extends BaseRuleImpl {
19
20     /**
21      * Applies the rule to the given url.
22      * @param context the context we're spidering under
23      * @param currentSite the site we're currently spidering
24      * @param url the url to be evaluated
25      * @return Decision object telling whether the url should be accepted.
26      * This implementation always returns a reject decision.
27      */

28     public Decision apply(SpiderContext context, Site currentSite, URL JavaDoc url) {
29         return new DecisionInternal(Decision.RULE_IGNORE, "reject all rule - so resource is ignored");
30     }
31
32 }
33
Popular Tags