com.mkdoc.jspider
Class AbstractMimeTypeRule

java.lang.Object
  |
  +--net.javacoding.jspider.core.rule.impl.BaseRuleImpl
        |
        +--com.mkdoc.jspider.AbstractMimeTypeRule
All Implemented Interfaces:
net.javacoding.jspider.spi.Rule
Direct Known Subclasses:
HtmlAndRdfMimeTypeOnlyRule, HtmlAndTextMimeTypeOnlyRule, RdfMimeTypeOnlyRule, TextMimeTypeOnlyRule

public abstract class AbstractMimeTypeRule
extends net.javacoding.jspider.core.rule.impl.BaseRuleImpl

Abstract superclass for MIME type rules.

Version:
0.1 2005-12-13
Author:
Philip Shaw

Constructor Summary
AbstractMimeTypeRule()
           
 
Method Summary
protected  boolean accept(java.lang.String mime)
          Check whether a MIME type is accepted by this a rule.
 net.javacoding.jspider.api.model.Decision apply(net.javacoding.jspider.core.SpiderContext context, net.javacoding.jspider.api.model.Site currentSite, java.net.URL url)
          Decide whether to process a given URL.
protected abstract  java.lang.String[] getAcceptedTypes()
          Get an array of the accepted MIME types.
 
Methods inherited from class net.javacoding.jspider.core.rule.impl.BaseRuleImpl
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMimeTypeRule

public AbstractMimeTypeRule()
Method Detail

apply

public final net.javacoding.jspider.api.model.Decision apply(net.javacoding.jspider.core.SpiderContext context,
                                                             net.javacoding.jspider.api.model.Site currentSite,
                                                             java.net.URL url)
Decide whether to process a given URL.

Specified by:
apply in interface net.javacoding.jspider.spi.Rule
Specified by:
apply in class net.javacoding.jspider.core.rule.impl.BaseRuleImpl
Parameters:
context - The spidering context for the URL.
currentSite - The site the URL belongs to.
url - The URL to decide upon.
Returns:
A decision whether to accept this URL for processing.
Since:
Version 0.1 2005-08-08

accept

protected final boolean accept(java.lang.String mime)
Check whether a MIME type is accepted by this a rule.

Parameters:
mime - The MIME type declared by the origin server.
Returns:
true if the type is accepted.
Since:
Version 0.1 2005-12-13

getAcceptedTypes

protected abstract java.lang.String[] getAcceptedTypes()
Get an array of the accepted MIME types.

Returns:
An array of accepted MIME types.
Since:
Version 0.1 2005-12-13