org.tranche.httpd
Class GetHandler

java.lang.Object
  extended by org.tranche.httpd.AbstractHttpHandler
      extended by org.tranche.httpd.GetHandler
All Implemented Interfaces:
IFileResources, IHttpHandler

public class GetHandler
extends AbstractHttpHandler

Handler for HTTP-GET. It is only able to echo back the browser request.

Author:
Takis Papoulias

Field Summary
static boolean DEBUG
          Debug flag reserved for midium level of stdout vebrocity.
static boolean DEBUG_VERBOSE
          Debug flag reserver for a higher level of stdout vebrocity.
static boolean ECHO
          Flag for debugging an input stream.
static int READ_AHEAD
          Size to be used in marking an input stream.
 
Fields inherited from class org.tranche.httpd.AbstractHttpHandler
httpVersion, is, os, pvMap, requestCode, requestName
 
Fields inherited from interface org.tranche.httpd.IFileResources
HTTP_PAGE_DIRECTORY, HTTP_PROPERTIES_DIRECTORY, HTTP_RESPONSE_MESSAGES_PROP_FILE, LOCALE
 
Constructor Summary
GetHandler()
           
 
Method Summary
static byte[] get(java.lang.String requestName)
           
static HttpConstant getContentType(java.lang.String requestName)
           
 void handle()
          Handles the HTTP request.
 
Methods inherited from class org.tranche.httpd.AbstractHttpHandler
send, sendError, setHeaderPV, setHttpVersion, setIn, setOut, setRequestCode, setRequestName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static final boolean DEBUG
Debug flag reserved for midium level of stdout vebrocity.

See Also:
Constant Field Values

DEBUG_VERBOSE

public static final boolean DEBUG_VERBOSE
Debug flag reserver for a higher level of stdout vebrocity.

See Also:
Constant Field Values

ECHO

public static final boolean ECHO
Flag for debugging an input stream. Usually used to activate a block of code that marks an input stream.

See Also:
Constant Field Values

READ_AHEAD

public static final int READ_AHEAD
Size to be used in marking an input stream.

See Also:
Constant Field Values
Constructor Detail

GetHandler

public GetHandler()
Method Detail

handle

public void handle()
            throws java.io.IOException
Handles the HTTP request. Usually called by the SocketHandler to handle a GET request.

Throws:
java.io.IOException

getContentType

public static HttpConstant getContentType(java.lang.String requestName)

get

public static byte[] get(java.lang.String requestName)
                  throws java.io.IOException
Throws:
java.io.IOException


This code is free for use both commercially and non-commercially as stated in the project's license