org.tranche.httpd
Class Http

java.lang.Object
  extended by org.tranche.httpd.Http
All Implemented Interfaces:
IFileResources

public class Http
extends java.lang.Object
implements IFileResources

Utility method for writting the HTTP protocol.

Author:
TPapoulias

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 interface org.tranche.httpd.IFileResources
HTTP_PAGE_DIRECTORY, HTTP_PROPERTIES_DIRECTORY, HTTP_RESPONSE_MESSAGES_PROP_FILE, LOCALE
 
Constructor Summary
Http()
           
 
Method Summary
static void print(java.io.PrintStream os, HttpConstant contentType, byte[] content)
           
static void print(java.io.PrintStream os, HttpConstant status, HttpConstant contentType, byte[] content)
           
static void printError(java.io.PrintStream os, HttpConstant errorNumber, java.lang.String errorDetails)
          Method for reporting to the browser an error
 
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

Http

public Http()
Method Detail

print

public static final void print(java.io.PrintStream os,
                               HttpConstant status,
                               HttpConstant contentType,
                               byte[] content)
                        throws java.io.IOException
Throws:
java.io.IOException

print

public static final void print(java.io.PrintStream os,
                               HttpConstant contentType,
                               byte[] content)
                        throws java.io.IOException
Throws:
java.io.IOException

printError

public static final void printError(java.io.PrintStream os,
                                    HttpConstant errorNumber,
                                    java.lang.String errorDetails)
                             throws java.io.IOException
Method for reporting to the browser an error

Parameters:
os -
errorNumber -
errorDetails -
Throws:
java.io.IOException


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