sunlabs.brazil.handler

Class DirectoryHandler

public class DirectoryHandler extends Object implements Handler

This is a bare-bones handler for providing directory listings for web servers. It is designed to be placed after the {@link sunlabs.brazil.server.FileHandler}. If no index file is found, Then a simple directory listing will be produced. Only files whose extensions are in the mime properties will be listed.

NOTE: This handler is obsolete, as it provides no control over the format of the directory listing, Use the {@link sunlabs.brazil.template.DirectoryTemplate} instead.

Configuration properties used:

prefix, suffix, glob, match
Specify the URL that triggers this handler. (See {@link MatchString}).
DirectoryName
This property is set by the {@link sunlabs.brazil.server.FileHandler} if the URL it was passed resolves to a directory, but no index file (e.g. index.html) was found.
setProps
If present, no content is returned. Instead, The properties "Directories" and "Files" are set in the request properties, so the format of the output may be generated dynamically. [Note: This feature is deprecated, use the {@link sunlabs.brazil.template.DirectoryTemplate} instead].
delim
The delimeter separating the file names. Defaults to a single space.
mime.xxx
Only documents ending in ".xxx" are considered. more than on mime.xxx parameters may be specified.

Version: 2.3, 06/11/13

Author: Stephen Uhler

Method Summary
booleaninit(Server server, String prefix)
Get the url prefix for this handler.
booleanrespond(Request request)
Display files in a directory, after being rejected by the FileHandler.

Method Detail

init

public boolean init(Server server, String prefix)
Get the url prefix for this handler.

respond

public boolean respond(Request request)
Display files in a directory, after being rejected by the FileHandler. The output is very simple.