rabbit.filter
Class AdFilter

java.lang.Object
  extended byrabbit.filter.HTMLFilter
      extended byrabbit.filter.AdFilter

public class AdFilter
extends HTMLFilter

This class switches advertising images into another image.


Constructor Summary
AdFilter(HTTPHeader request, HTTPHeader response)
          Create a new AdFilter for the given request, response pair.
 
Method Summary
 void filterHTML(HTMLBlock block)
          Removes advertising from the given block.
 boolean isEvil(java.lang.String str)
          Check if a string is evil (that is its probably advertising).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdFilter

public AdFilter(HTTPHeader request,
                HTTPHeader response)
Create a new AdFilter for the given request, response pair.

Parameters:
request - the actual request made.
response - the actual response being sent.
Method Detail

filterHTML

public void filterHTML(HTMLBlock block)
Removes advertising from the given block.

Specified by:
filterHTML in class HTMLFilter
Parameters:
block - the part of the html page we are filtering.

isEvil

public boolean isEvil(java.lang.String str)
Check if a string is evil (that is its probably advertising).

Parameters:
str - the String to check.