|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FileHandler
This FileHandler interface is meant for HTTP resources that represent executable files (in any way) inside the document root (such as CGI scripts, system commands, executables, ...). As configuration files such as .htaccess allow to define file handlers (AddHandler and SetHandler directives) there is the need to summarize those handlers together under one general interface. IMPLEMENTATION NOTE: subclasses should implement an empty-argument-list constructor to make the class instantiable using the Class.newInstance() method!
Method Summary | |
---|---|
HTTPHandler |
getHTTPHandler()
Get get FileHandler's global HTTPHandler. |
CustomLogger |
getLogger()
Get the custom logger to use to write log messages. |
Resource |
process(java.util.UUID sessionID,
HTTPHeaders headers,
PostDataWrapper postData,
java.io.File file,
java.net.URI requestURI)
The 'process' method is very generic. |
boolean |
requiresExistingFile()
Most file handlers operate on existing files that are located inside the local file system (such as the default handler does for simple file delivery). |
void |
setHTTPHandler(HTTPHandler handler)
Set the global HTTP handler. |
void |
setLogger(CustomLogger logger)
Set the logger to use. |
Method Detail |
---|
HTTPHandler getHTTPHandler()
void setHTTPHandler(HTTPHandler handler) throws java.lang.NullPointerException
handler
- The new handler (must not be null).
java.lang.NullPointerException
- If handler is null.CustomLogger getLogger()
void setLogger(CustomLogger logger) throws java.lang.NullPointerException
logger
- The new logger (must not be null).
java.lang.NullPointerException
- If logger is null.boolean requiresExistingFile()
Resource process(java.util.UUID sessionID, HTTPHeaders headers, PostDataWrapper postData, java.io.File file, java.net.URI requestURI) throws java.io.IOException, HeaderFormatException, DataFormatException, UnsupportedFormatException
sessionID
- The current session's ID.headers
- The HTTP request headers.postData
- The HTTP post data; if the method is not HTTP POST the 'postData' should be null
(or empty).file
- The requested file itself (inside the local file system).requestURI
- The requested URI (relative to DOCUMENT_ROOT).
java.io.IOException
HeaderFormatException
DataFormatException
UnsupportedFormatException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |