01: package net.javacoding.jspider.mod.rule;
02:
03: import net.javacoding.jspider.api.model.Decision;
04: import net.javacoding.jspider.api.model.Site;
05: import net.javacoding.jspider.core.SpiderContext;
06: import net.javacoding.jspider.core.rule.impl.BaseRuleImpl;
07: import net.javacoding.jspider.core.model.DecisionInternal;
08:
09: import java.net.URL;
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,
29: URL url) {
30: return new DecisionInternal(Decision.RULE_IGNORE,
31: "reject all rule - so resource is ignored");
32: }
33:
34: }
|