de.schwarzrot.app.net.service
Class FileHandler
java.lang.Object
de.schwarzrot.net.http.service.AbstractRequestHandler
de.schwarzrot.app.net.service.FileHandler
- All Implemented Interfaces:
- RequestHandler
public class FileHandler
- extends AbstractRequestHandler
handles HTTP requests as file requests, similar to common HTTP servers. Will
be the fallback for unknown/unsupported locations.
- Author:
- Reinhard Mantey
Fields inherited from interface de.schwarzrot.net.http.service.RequestHandler |
HTTP_CONTENT_LENGTH, HTTP_LANGUAGE, MIME_CSS, MIME_GIF, MIME_HTML, MIME_ICON, MIME_JPEG, MIME_JS, MIME_JSON, MIME_PNG, MIME_TIFF, MIME_UNKNOWN, QUERY_STRING, REQUEST_DEFAULT_HANDLER, REQUEST_DEFAULT_URL, REQUEST_GET_METHOD, REQUEST_HELP_URL, REQUEST_JSON_CHECK, REQUEST_LOCATION, REQUEST_METHOD, REQUEST_OPTIONS_METHOD, REQUEST_POST_METHOD, REQUEST_TIME, REQUEST_URI, REQUEST_WEBIF_BASE, REQUEST_WEBIF_EXT, REQUEST_WEBIF_ROOT, RESPONSE_HEADER, RESPONSE_LEN_HEADER, RESPONSE_STATUS_HEADER, SERVER_PROTOCOL |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileHandler
public FileHandler()
process
public void process(Socket clientSocket,
Map<String,String> header,
Map<String,String> request)
- Description copied from interface:
RequestHandler
- this is the entrypoint for request processing. Will be called by the
ProtocolHandler
. The request handler that decides, what to do,
based on request parameters.
- Parameters:
clientSocket
- - the socket for client communicationheader
- - a map that contains all requests header parametersrequest
- - a map that contains all request parameters
replySuccess
public boolean replySuccess(PrintWriter writer,
HttpStatusCode success,
String errorMessage)
throws Exception
- Description copied from interface:
RequestHandler
- centralized message creator service
- Specified by:
replySuccess
in interface RequestHandler
- Specified by:
replySuccess
in class AbstractRequestHandler
- Parameters:
writer
- - the communication channel to the clientsuccess
- - the status code of the last requesterrorMessage
- - the error message for the client
- Throws:
Exception
- - type of exception varies depending on the protocol used
usage
public String usage()
- Description copied from interface:
RequestHandler
- tells about the services and their parameters
- Returns:
- - the description message
Submit
a bug or request a feature
SRJRCFrames is published according to the
GNU General Public License
Copyright 2005-2012
Reinhard Mantey - some rights reserved.