com.cometway.net
Class HTTPRequest

java.lang.Object
  extended by com.cometway.net.HTTPRequest

public class HTTPRequest
extends java.lang.Object

This class is used as a data object which stores the HTTP/1.0 request. This class will provide the HTTP/1.0 request in String form. This class is used by the HTTPLoader.


Field Summary
 java.lang.String acceptString
          * This is the String of what media to accept.
 java.lang.String authString
          This is the BASIC authentication to use
static int CLOSE_CONNECTION
          * This is the CLOSE connection type
 int connection
          * This field is to indicate the connection type
 java.lang.String contentEncoding
          * This is the content encoding of the request data.
 java.lang.String contentType
          * This is the content type of the request data.
 java.io.InputStream dataSource
           
static int GET_REQUEST_TYPE
          * This is the type for a full GET request
static int HEAD_REQUEST_TYPE
           
 java.lang.String host
          * This is the host field of the request.
static int KEEP_ALIVE_CONNECTION
          * This is the KEEP ALIVE connection type
 java.util.Vector otherHeaders
          * This is a Vector of Strings for user specific headers
static int POST_REQUEST_TYPE
          * This is the type for a POST request
static int PUT_REQUEST_TYPE
           
 java.lang.String referer
          * This is the referer field.
 java.lang.String requestData
          * This is the request data, which appears after the header.
 long requestDataLength
           
 java.lang.String requestString
          * This goes after the request type
 int requestType
          * This field is to indicate what request this is
static int SHORT_GET_REQUEST_TYPE
          * This is the type for a short GET request
 boolean useCarraigeReturns
           
 java.lang.String userAgent
          * This is the user agent field.
 
Constructor Summary
HTTPRequest(java.lang.String request)
          * This generates a simple HTTP request using the request string given and a SHORT GET type.
 
Method Summary
 void addHeader(java.lang.String header)
          * This method adds a user specific header.
 void addHeader(java.lang.String name, java.lang.String value)
          * This method adds a user specific header.
 boolean equals(java.lang.Object o)
           
 java.lang.String toString()
          * This method builds and prints the request to a String.
 boolean writeRequest(java.io.BufferedWriter out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GET_REQUEST_TYPE

public static final int GET_REQUEST_TYPE
* This is the type for a full GET request

See Also:
Constant Field Values

POST_REQUEST_TYPE

public static final int POST_REQUEST_TYPE
* This is the type for a POST request

See Also:
Constant Field Values

SHORT_GET_REQUEST_TYPE

public static final int SHORT_GET_REQUEST_TYPE
* This is the type for a short GET request

See Also:
Constant Field Values

HEAD_REQUEST_TYPE

public static final int HEAD_REQUEST_TYPE
See Also:
Constant Field Values

PUT_REQUEST_TYPE

public static final int PUT_REQUEST_TYPE
See Also:
Constant Field Values

requestType

public int requestType
* This field is to indicate what request this is


requestString

public java.lang.String requestString
* This goes after the request type


requestData

public java.lang.String requestData
* This is the request data, which appears after the header.


dataSource

public java.io.InputStream dataSource

requestDataLength

public long requestDataLength

CLOSE_CONNECTION

public static final int CLOSE_CONNECTION
* This is the CLOSE connection type

See Also:
Constant Field Values

KEEP_ALIVE_CONNECTION

public static final int KEEP_ALIVE_CONNECTION
* This is the KEEP ALIVE connection type

See Also:
Constant Field Values

connection

public int connection
* This field is to indicate the connection type


referer

public java.lang.String referer
* This is the referer field.


userAgent

public java.lang.String userAgent
* This is the user agent field.


host

public java.lang.String host
* This is the host field of the request.


acceptString

public java.lang.String acceptString
* This is the String of what media to accept.


contentType

public java.lang.String contentType
* This is the content type of the request data.


contentEncoding

public java.lang.String contentEncoding
* This is the content encoding of the request data.


otherHeaders

public java.util.Vector otherHeaders
* This is a Vector of Strings for user specific headers


authString

public java.lang.String authString
This is the BASIC authentication to use


useCarraigeReturns

public boolean useCarraigeReturns
Constructor Detail

HTTPRequest

public HTTPRequest(java.lang.String request)
* This generates a simple HTTP request using the request string given and a SHORT GET type.

Method Detail

addHeader

public void addHeader(java.lang.String name,
                      java.lang.String value)
* This method adds a user specific header.


addHeader

public void addHeader(java.lang.String header)
* This method adds a user specific header.


equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

writeRequest

public boolean writeRequest(java.io.BufferedWriter out)

toString

public java.lang.String toString()
* This method builds and prints the request to a String.

Overrides:
toString in class java.lang.Object