|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.ibm.wbi.Meg
|
+--com.ibm.wbi.Generator
|
+--com.ibm.wbi.protocol.http.HttpGenerator
|
+--com.ibm.wbi.protocol.http.beans.FourStepHttpGenerator
|
+--com.ibm.wbi.protocol.http.beans.HtmlGenerator
|
+--com.ibm.wbi.protocol.http.beans.DirectoryGenerator
A Generator for delivering an HTML rendition of a disk directory.
The LinkToParentDirectory property, when set to true (the default is false), means that HTML renditions of directories will contain a link to the ".." directory, the parent of the current directory. When set to false, this link will not be shown.
By default, the browser is allowed to cache the document. This property can be can be adjusted with the setCache(boolean) and isCache() methods of HttpGenerator.
HttpGenerator| Fields inherited from class com.ibm.wbi.protocol.http.beans.HtmlGenerator |
COPYRIGHT |
| Fields inherited from class com.ibm.wbi.protocol.http.HttpGenerator |
http |
| Fields inherited from class com.ibm.wbi.Meg |
EDITOR, GENERATOR, MONITOR, REQUEST_EDITOR, UNDEFINED |
| Constructor Summary | |
DirectoryGenerator()
construct an instance with a null File, and not to link to the parent directory. |
|
DirectoryGenerator(java.io.File _file)
construct an instance with the given File and not to link to parent directory. |
|
DirectoryGenerator(java.lang.String filename)
construct an instance with the given Filename and not to link to parent directory. |
|
| Method Summary | |
java.lang.String |
getFilename()
access the Filename property |
protected java.lang.String |
getHtmlString(RequestEvent e)
Produce an HTML rendition of the specified directory. |
void |
handleRequest(RequestEvent e)
Override the inherited handleRequest(...) method so that we can ensure that the requested URL ends with a '/'. |
boolean |
isLinkToParentDirectory()
Retrieve the LinkToParentDirectory property status. |
void |
setFile(java.io.File f)
Set the file property. |
void |
setFile(java.io.File directory,
java.lang.String filename)
Set the file property. |
void |
setFile(java.lang.String directory,
java.lang.String filename)
Set the file property. |
void |
setFilename(java.lang.String fn)
set the Filename property with the name of the file to be served, (either an absolute filepath, or relative to the WBI working directory). |
void |
setLinkToParentDirectory(boolean ltpd)
Set the LinkToParentDirectory property. |
protected boolean |
verify()
Make sure a file has been set and that the file exists. |
| Methods inherited from class com.ibm.wbi.protocol.http.beans.HtmlGenerator |
writeContent |
| Methods inherited from class com.ibm.wbi.protocol.http.beans.FourStepHttpGenerator |
getHeader, initialize, verify |
| Methods inherited from class com.ibm.wbi.protocol.http.HttpGenerator |
add, addCookie, getContentType, getHttpResponse, getHttpResponseString, getResponseCode, getResponseText, isCache, produceHeader, set, setCache, setContentLength, setContentType, setResponseCode, setResponseText, setServer, writeHeader |
| Methods inherited from class com.ibm.wbi.Generator |
getType |
| Methods inherited from class com.ibm.wbi.Meg |
forwardRequest, getCondition, getEnabled, getMegProperty, getMegProperty, getMegPropertyKeys, getName, getPlugin, getPriority, getSystemContext, initialize, initialize, isEnabled, isMegApplicable, loadMegResources, run, setCondition, setEnabled, setMegProperty, setName, setPriority, setSystemContext, setup, setup, setup, setup |
| Constructor Detail |
public DirectoryGenerator()
public DirectoryGenerator(java.io.File _file)
_file - the File whose directory is to be generatedpublic DirectoryGenerator(java.lang.String filename)
filename - the name of the file to be served.setFilename(String)| Method Detail |
public void setLinkToParentDirectory(boolean ltpd)
ltpd - Boolean value indicating whether a ".." link is provided or not.public boolean isLinkToParentDirectory()
true
or not false.public void setFilename(java.lang.String fn)
fn - the Filenamepublic java.lang.String getFilename()
public void setFile(java.io.File f)
f - The file to be used by the DirectoryGenerator.
public void setFile(java.lang.String directory,
java.lang.String filename)
directory - Name of the directory (path) the file resides in.filename - Filename relative to the directory specified in the
first parameter.
public void setFile(java.io.File directory,
java.lang.String filename)
directory - File object representing the directory (path) the file resides in.filename - Filename relative to the directory specified in the
first parameter.protected boolean verify()
protected java.lang.String getHtmlString(RequestEvent e)
getHtmlString in class HtmlGeneratore - RequestEvent object.
public void handleRequest(RequestEvent e)
throws RequestRejectedException,
java.io.IOException
handleRequest in class FourStepHttpGeneratore - RequestEvent object.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||