com.faunos.util.net.http.file
Class SimpleFileDefaulter

java.lang.Object
  extended by com.faunos.util.net.http.file.SimpleFileDefaulter
All Implemented Interfaces:
DirectoryFileDefaulter

public class SimpleFileDefaulter
extends Object
implements DirectoryFileDefaulter

A simple, stateless, filename-based DirectoryFileDefaulter implementation.

Author:
Babak Farhang

Field Summary
static SimpleFileDefaulter INDEX_DOT_HTML
          An instance that returns an "index.html" file.
 
Constructor Summary
SimpleFileDefaulter(String filename)
          Creates a new instance with the specified simple filename.
 
Method Summary
 File getDefaultChild(File directory)
          Returns the default file that should be returned for the given directory.
 String getFilename()
          Returns the filename passed in at instantiation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDEX_DOT_HTML

public static final SimpleFileDefaulter INDEX_DOT_HTML
An instance that returns an "index.html" file.

Constructor Detail

SimpleFileDefaulter

public SimpleFileDefaulter(String filename)
Creates a new instance with the specified simple filename.

Method Detail

getFilename

public String getFilename()
Returns the filename passed in at instantiation.


getDefaultChild

public File getDefaultChild(File directory)
                     throws IOException
Description copied from interface: DirectoryFileDefaulter
Returns the default file that should be returned for the given directory. Since this is a rule-based interface, it is not required that the returned file even exist. Also, returning null is allowed.

Specified by:
getDefaultChild in interface DirectoryFileDefaulter
Throws:
IOException


SourceForge.net Logo