com.cometway.net
Class HTTPResponse

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

public class HTTPResponse
extends java.lang.Object

This class is a data object which stores a HTTP/1.1 response. This class is used by the HTTPLoader


Field Summary
static java.lang.String CODE_200
          * These are the result codes supported
static java.lang.String CODE_201
           
static java.lang.String CODE_204
           
static java.lang.String CODE_301
           
static java.lang.String CODE_302
           
static java.lang.String CODE_400
           
static java.lang.String CODE_401
           
static java.lang.String CODE_403
           
static java.lang.String CODE_404
           
static java.lang.String CODE_500
           
 java.lang.String data
          * This is the data that was stored in the body of the HTTP response
 java.util.Hashtable headers
          * This is a hashtable of all the headers in the HTTP response from the web server
 java.lang.String redirectLocation
          * This is the location of the redirect when the result code is 30*
 java.lang.String resultCode
          * This is the result code of the response
 
Constructor Summary
HTTPResponse()
           
 
Method Summary
 void addHeader(java.lang.String headerName, java.lang.String headerValue)
          * Use this method to add a header value for a given header name.
 java.lang.String[] getHeader(java.lang.String headerName)
          * Use this method to get the header value(s) for a given header name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CODE_200

public static final java.lang.String CODE_200
* These are the result codes supported

See Also:
Constant Field Values

CODE_201

public static final java.lang.String CODE_201
See Also:
Constant Field Values

CODE_204

public static final java.lang.String CODE_204
See Also:
Constant Field Values

CODE_301

public static final java.lang.String CODE_301
See Also:
Constant Field Values

CODE_302

public static final java.lang.String CODE_302
See Also:
Constant Field Values

CODE_400

public static final java.lang.String CODE_400
See Also:
Constant Field Values

CODE_401

public static final java.lang.String CODE_401
See Also:
Constant Field Values

CODE_403

public static final java.lang.String CODE_403
See Also:
Constant Field Values

CODE_404

public static final java.lang.String CODE_404
See Also:
Constant Field Values

CODE_500

public static final java.lang.String CODE_500
See Also:
Constant Field Values

headers

public java.util.Hashtable headers
* This is a hashtable of all the headers in the HTTP response from the web server


resultCode

public java.lang.String resultCode
* This is the result code of the response


redirectLocation

public java.lang.String redirectLocation
* This is the location of the redirect when the result code is 30*


data

public java.lang.String data
* This is the data that was stored in the body of the HTTP response

Constructor Detail

HTTPResponse

public HTTPResponse()
Method Detail

getHeader

public java.lang.String[] getHeader(java.lang.String headerName)
* Use this method to get the header value(s) for a given header name.


addHeader

public void addHeader(java.lang.String headerName,
                      java.lang.String headerValue)
* Use this method to add a header value for a given header name. If the header name already has a value, the values are stored in a Vector and added to the hashtable under the header name.