Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.enhydra.httpServerTest.common
Class HttpServerTestUtils  view HttpServerTestUtils download HttpServerTestUtils.java

java.lang.Object
  extended byorg.enhydra.httpServerTest.common.HttpServerTestUtils

public class HttpServerTestUtils
extends java.lang.Object

This class provides static data and methods that are shared by both the client and server sides of this test. See below for details.


Field Summary
static java.lang.String CGI_PARAM_SESSION_KEY
          The string designating a session CGI parameter.
static java.lang.String[] defaulHeaderArray
          This is an array of headers commonly set automatically by HTTPClient when issueing request.
static java.lang.String GET_REQUEST_TAG
          The string representing an http GET request method.
static java.lang.String HTTP_COOKIE_SESSION_KEY
          The string designating a session cookie.
static java.lang.String POST_FILE_UPLOAD_PREFIX
          This is the name used to designate a file upload within a multi- part mime message.
static java.lang.String POST_REQUEST_TAG
          The string representing an http POST request method.
static java.lang.String POST_URL_ENCODED_CONTENT_TYPE
          This string is used by the server side components to indicate the type of post method that was used.
 
Constructor Summary
HttpServerTestUtils()
           
 
Method Summary
static java.lang.String calculateFileHash(java.lang.String fileName)
          This function will calculate an MD5 hashkey for the given file name.
static boolean isDefaultHeader(java.lang.String headerName)
          This fuction will loop through the 'defaultHeaderArray' and return true if the supplied header is considered 'default' and false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTTP_COOKIE_SESSION_KEY

public static final java.lang.String HTTP_COOKIE_SESSION_KEY
The string designating a session cookie.

See Also:
Constant Field Values

CGI_PARAM_SESSION_KEY

public static final java.lang.String CGI_PARAM_SESSION_KEY
The string designating a session CGI parameter.

See Also:
Constant Field Values

GET_REQUEST_TAG

public static final java.lang.String GET_REQUEST_TAG
The string representing an http GET request method.

See Also:
Constant Field Values

POST_REQUEST_TAG

public static final java.lang.String POST_REQUEST_TAG
The string representing an http POST request method.

See Also:
Constant Field Values

POST_URL_ENCODED_CONTENT_TYPE

public static final java.lang.String POST_URL_ENCODED_CONTENT_TYPE
This string is used by the server side components to indicate the type of post method that was used. Requests submitted using this header can hava all CGI arguments found in the same manner as a GET request (from the servlet's getParameter*() methods). Otherwise, the request consists of a multi-part mime and must be decoded.

See Also:
Constant Field Values

POST_FILE_UPLOAD_PREFIX

public static final java.lang.String POST_FILE_UPLOAD_PREFIX
This is the name used to designate a file upload within a multi- part mime message.

See Also:
Constant Field Values

defaulHeaderArray

public static final java.lang.String[] defaulHeaderArray
This is an array of headers commonly set automatically by HTTPClient when issueing request.

See Also:
HTTPClient.HTTPConnection
Constructor Detail

HttpServerTestUtils

public HttpServerTestUtils()
Method Detail

isDefaultHeader

public static boolean isDefaultHeader(java.lang.String headerName)
This fuction will loop through the 'defaultHeaderArray' and return true if the supplied header is considered 'default' and false otherwise.


calculateFileHash

public static java.lang.String calculateFileHash(java.lang.String fileName)
                                          throws java.lang.Exception
This function will calculate an MD5 hashkey for the given file name. The hashkey is Base64 encoded for safe transport over the connection.