sunlabs.brazil.filter

Class PlainFilter

public class PlainFilter extends Object implements Filter

Filter to turn text/plain into html. This allows plain text to be processed by other filters that only deal with html.

The following server properties are used:

template
The string to use as an html template. The string should contain a single "%", which is replaced by the text/plain content. The default stuff the content between <pre>...</pre>.

Version: 2.2

Author: Stephen Uhler

Method Summary
byte[]filter(Request request, MimeHeaders headers, byte[] content)
Wrap html around text/plain, converting it to html.
booleaninit(Server server, String prefix)
booleanrespond(Request request)
This is the request object before the content was fetched
booleanshouldFilter(Request request, MimeHeaders headers)
Only filter text/plain documents

Method Detail

filter

public byte[] filter(Request request, MimeHeaders headers, byte[] content)
Wrap html around text/plain, converting it to html. Change the content-type to text/html.

init

public boolean init(Server server, String prefix)

respond

public boolean respond(Request request)
This is the request object before the content was fetched

shouldFilter

public boolean shouldFilter(Request request, MimeHeaders headers)
Only filter text/plain documents