sunlabs.brazil.handler

Class DefaultFileHandler

public class DefaultFileHandler extends Object implements Handler

Handler for appending a url ending with '/' into the appropriate url based on a default file in the file system.

The following request properties are used:

defaults
The names of the default files to search for in the directory implied by the URL. The first one that exists will cause its name to be appended to the URL. Defaults to "index.html".
root
The document root to look for files. If none is found with our prefix, then "root" is examined. Defaults to ".".
DirectoryName
This property is set if the URL represents a valid directory in the document root.
fileName
This property is set to the name of the default file, if one was found.
If a url ends with "/", but is a readable plain file, the "/" is removed

Version: %V% 05/06/28

Author: Stephen Uhler

Method Summary
booleaninit(Server server, String prefix)
Remember our prefix in the properties table.
booleanrespond(Request request)
If the url ends with a "/" look around in the corrosponding directory to find a suitable default file, and then change the url.

Method Detail

init

public boolean init(Server server, String prefix)
Remember our prefix in the properties table.

respond

public boolean respond(Request request)
If the url ends with a "/" look around in the corrosponding directory to find a suitable default file, and then change the url.

Returns: Always returns false.