rabbit.filter
Class AdFilter
java.lang.Object
rabbit.filter.HtmlFilter
rabbit.filter.AdFilter
- All Implemented Interfaces:
- HtmlFilterFactory
public class AdFilter
- extends HtmlFilter
This class switches advertising images into another image.
- Author:
- Robert Olofsson
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AdFilter
public AdFilter()
AdFilter
public AdFilter(Connection con,
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.
newFilter
public HtmlFilter newFilter(Connection con,
HttpHeader request,
HttpHeader response)
- Description copied from interface:
HtmlFilterFactory
- Get a new HtmlFilter for the given request, response pair.
- Parameters:
con
- the Connection handling the request.request
- the actual request made.response
- the actual response being sent.
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(String str)
- Check if a string is evil (that is its probably advertising).
- Parameters:
str
- the String to check.