SRJRCFrames
v0.1.296

de.schwarzrot.app.net.service
Class FileHandler

java.lang.Object
  extended by de.schwarzrot.net.http.service.AbstractRequestHandler
      extended by 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

Field Summary
 
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
 
Constructor Summary
FileHandler()
           
 
Method Summary
 void process(Socket clientSocket, Map<String,String> header, Map<String,String> request)
          this is the entrypoint for request processing.
 boolean replySuccess(PrintWriter writer, HttpStatusCode success, String errorMessage)
          centralized message creator service
 String usage()
          tells about the services and their parameters
 
Methods inherited from class de.schwarzrot.net.http.service.AbstractRequestHandler
doIDAction, getHandlerIdentifier, getLogger, getProtocolHandler, getServer, getTransactionFactory, initResponse, initResponse, replySuccess, setup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileHandler

public FileHandler()
Method Detail

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 communication
header - - a map that contains all requests header parameters
request - - 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 client
success - - the status code of the last request
errorMessage - - 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

SRJRCFrames
v0.1.296

hosted at
Find SRJRCFrames at SourceForge.net. Fast, secure and free:
           Open Source Software download
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.