sunlabs.brazil.handler

Class ProxyPropertiesHandler

public class ProxyPropertiesHandler extends GenericProxyHandler implements Handler

Obtain properties format content from remote websites, and add it to the current request properties. Many of the handlers are designed to produce side effects, by inserting values into the request properties (see PropertiesHandler). If they are instead configured to produce the properties in java properties format, then this handler will read their output, and place the result in the request object on their behalf. This capability allows certain handlers to be run on other web sites, yet behave as if they are in the handler chain. The following request properties are used:
type
The document type for files to process as java properties (defaults to text/plain)
prepend
The prefix that should be prepended to each property before it is inserted into the request properties
url
The url that should be used to fetch the remote content. If not specified, the curent url is used instead. Any ${...} constructs in the url are evaluated at each request.
NOTE: This capability should be generalized.

Version: 2.2, 04/08/30

Author: Stephen Uhler

Method Summary
booleaninit(Server server, String prefix)
byte[]modifyContent(Request request, byte[] content)
booleanrespond(Request request)
protected booleanshouldFilter(MimeHeaders headers)
See if the content needs to be filtered Return "true" if "modifyContent" should be called

Method Detail

init

public boolean init(Server server, String prefix)

modifyContent

public byte[] modifyContent(Request request, byte[] content)

respond

public boolean respond(Request request)

shouldFilter

protected boolean shouldFilter(MimeHeaders headers)
See if the content needs to be filtered Return "true" if "modifyContent" should be called

Parameters: headers mime headers for data to proxy