pygmy.handlers
Class DirectoryHandler

java.lang.Object
  extended by pygmy.core.AbstractHandler
      extended by pygmy.handlers.DirectoryHandler
All Implemented Interfaces:
Handler

public class DirectoryHandler
extends AbstractHandler
implements Handler

This sends back a directory listing in html text. The look and feel is customizable through a cascading style sheet to use. The directory listing is ordered by DirectoryHandler.ComparableComparator. The referenced classes in the CSS are:

Parameter NameExplanationDefault ValueRequired
url-prefixThe prefix to filter request urls.NoneYes
rootA local system path to the root of the folder to share.NoneYes
cssThe name stylesheet to use for customizing the style of the display. If unspecified a default style will be inlined in the HTML.NoneNo


Nested Class Summary
static class DirectoryHandler.ComparableComparator
          This orders directories by calling compareTo() method.
 
Field Summary
static ConfigOption CSS_OPTION
           
static ConfigOption ROOT_OPTION
           
 
Fields inherited from class pygmy.core.AbstractHandler
handlerName, server, URL_PREFIX_OPTION, urlPrefix
 
Constructor Summary
DirectoryHandler()
           
 
Method Summary
protected  boolean handleBody(HttpRequest request, HttpResponse response)
           
 boolean initialize(java.lang.String handlerName, Server server)
           
 
Methods inherited from class pygmy.core.AbstractHandler
getMimeType, getName, getUrlPrefix, handle, isRequestdForHandler, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface pygmy.core.Handler
getName, handle, shutdown
 

Field Detail

ROOT_OPTION

public static final ConfigOption ROOT_OPTION

CSS_OPTION

public static final ConfigOption CSS_OPTION
Constructor Detail

DirectoryHandler

public DirectoryHandler()
Method Detail

initialize

public boolean initialize(java.lang.String handlerName,
                          Server server)
Specified by:
initialize in interface Handler
Overrides:
initialize in class AbstractHandler

handleBody

protected boolean handleBody(HttpRequest request,
                             HttpResponse response)
                      throws java.io.IOException
Overrides:
handleBody in class AbstractHandler
Throws:
java.io.IOException