sunlabs.brazil.filter

Class MD5Filter

public class MD5Filter extends Object implements Filter

Filter to compute the MD5 checksum of the content, and generate the appropriate "Content-MD5" http header. As md5 checksum generation can be expensive, care should be taken as to which types of content are digested.

The following server properties are used:

prefix, suffix, glob, match
Specify the URLs that trigger this filter (See {@link sunlabs.brazil.handler.MatchString}).

Version: 2.3

Author: Stephen Uhler

Method Summary
byte[]filter(Request request, MimeHeaders headers, byte[] content)
Compute digest, add to header.
booleaninit(Server server, String prefix)
Make sure MD5 is available in this VM, or don't start.
booleanrespond(Request request)
This is the request object before the content was fetched.
booleanshouldFilter(Request request, MimeHeaders headers)
Only filter url's that match.

Method Detail

filter

public byte[] filter(Request request, MimeHeaders headers, byte[] content)
Compute digest, add to header.

init

public boolean init(Server server, String prefix)
Make sure MD5 is available in this VM, or don't start.

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 url's that match.