com.mkdoc.jspider
Class HtmlAndRdfMimeTypeOnlyRule

java.lang.Object
  |
  +--net.javacoding.jspider.core.rule.impl.BaseRuleImpl
        |
        +--com.mkdoc.jspider.HtmlAndRdfMimeTypeOnlyRule
All Implemented Interfaces:
net.javacoding.jspider.spi.Rule

public class HtmlAndRdfMimeTypeOnlyRule
extends net.javacoding.jspider.core.rule.impl.BaseRuleImpl

A rule to parse HTML and RDF content types.

Version:
0.2 2005-10-28
Author:
Philip Shaw

Constructor Summary
HtmlAndRdfMimeTypeOnlyRule()
           
 
Method Summary
protected  boolean accept(java.lang.String mime)
          Check whether a MIME type is accepted by this 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.
 
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

HtmlAndRdfMimeTypeOnlyRule

public HtmlAndRdfMimeTypeOnlyRule()
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 rule.

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