com.ibm.wbi.protocol.http
Class HttpResponseHeader

java.lang.Object
  |
  +--com.ibm.wbi.protocol.http.HttpHeaderAscii
        |
        +--com.ibm.wbi.protocol.http.HttpResponseHeader

public class HttpResponseHeader
extends HttpHeaderAscii

HttpResponseHeader represents the header of an HTTP response.

See Also:
HttpRequestHeader, HttpHeaderAscii

Field Summary
protected  java.lang.String code
           
protected static java.lang.String DEFAULT_CODE
           
protected static java.lang.String DEFAULT_MESSAGE
           
protected  java.lang.String message
           
 
Fields inherited from class com.ibm.wbi.protocol.http.HttpHeaderAscii
httpVersion, mime, stamp
 
Constructor Summary
HttpResponseHeader()
          Construct a new, empty HttpRepsonseHeader with default code (200), message ("Ok"), and version ("HTTP/1.0").
HttpResponseHeader(byte[] h)
          Construct a new HttpResponseHeader from the specified bytes representing ASCII characters.
HttpResponseHeader(byte[] h, int offset, int length)
          Construct a new HttpResponseHeader from the specified bytes representing ASCII characters.
HttpResponseHeader(HttpResponseHeader old)
          Construct a new HttpResponseHeader that is a copy of another.
HttpResponseHeader(MimeHeaderAscii m)
          Construct a new HttpRepsonseHeader with default code (200), message ("Ok"), and version ("HTTP/1.0") and the specified MIME headers.
HttpResponseHeader(java.lang.String s)
          Construct a new HttpRepsonseHeader from the specified String.
 
Method Summary
 byte[] asciiGetBytes()
          Return a textual representation of this header, encoded into bytes with US-ASCII encoding.
 java.lang.Object clone()
          Return a clone of this HttpResponseHeader.
 java.lang.String getCode()
          Return the HTTP status code.
 java.lang.String getMessage()
          Get the HTTP status message.
static void main(java.lang.String[] argv)
           
protected  void parseFirstLine(java.lang.String line)
           
 void setCode(java.lang.String s)
          Set the HTTP status code.
 void setMessage(java.lang.String s)
          Set the HTTP status message.
 java.lang.String toString()
          Return a String representation of this header.
 
Methods inherited from class com.ibm.wbi.protocol.http.HttpHeaderAscii
add, add, copyMimeHeader, get, getAll, getMimeHeaderString, getRaw, getVersion, keys, parseAllHeaderFields, parseAllSplitHeaderFields, parseAllSplitHeaderFields, parseHeader, parseHeaderField, remove, set, set, setVersion, stamp, stamped
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

code

protected java.lang.String code

message

protected java.lang.String message

DEFAULT_CODE

protected static final java.lang.String DEFAULT_CODE

DEFAULT_MESSAGE

protected static final java.lang.String DEFAULT_MESSAGE
Constructor Detail

HttpResponseHeader

public HttpResponseHeader()
Construct a new, empty HttpRepsonseHeader with default code (200), message ("Ok"), and version ("HTTP/1.0").

HttpResponseHeader

public HttpResponseHeader(MimeHeaderAscii m)
Construct a new HttpRepsonseHeader with default code (200), message ("Ok"), and version ("HTTP/1.0") and the specified MIME headers.
Parameters:
m - The MIME headers to use.

HttpResponseHeader

public HttpResponseHeader(byte[] h)
                   throws MalformedHeaderException
Construct a new HttpResponseHeader from the specified bytes representing ASCII characters.
Parameters:
h - The bytes.

HttpResponseHeader

public HttpResponseHeader(byte[] h,
                          int offset,
                          int length)
                   throws MalformedHeaderException
Construct a new HttpResponseHeader from the specified bytes representing ASCII characters.
Parameters:
h - The array containing the bytes.
offset - The offset within the array where the bytes start.
length - The length of the bytes within the array.

HttpResponseHeader

public HttpResponseHeader(java.lang.String s)
                   throws MalformedHeaderException
Construct a new HttpRepsonseHeader from the specified String.
Parameters:
s - The String containing the header text.

HttpResponseHeader

public HttpResponseHeader(HttpResponseHeader old)
Construct a new HttpResponseHeader that is a copy of another.
Parameters:
old - The header to copy.
Method Detail

clone

public java.lang.Object clone()
Return a clone of this HttpResponseHeader.
Overrides:
clone in class java.lang.Object
Returns:
The clone.

getCode

public java.lang.String getCode()
Return the HTTP status code.
Returns:
The HTTP status code.

setCode

public void setCode(java.lang.String s)
Set the HTTP status code.
Parameters:
s - The HTTP status code.

getMessage

public java.lang.String getMessage()
Get the HTTP status message.
Returns:
The HTTP status message.

setMessage

public void setMessage(java.lang.String s)
Set the HTTP status message.
Parameters:
s - The HTTP status message.

toString

public java.lang.String toString()
Return a String representation of this header.
Overrides:
toString in class HttpHeaderAscii
Returns:
The header string.

asciiGetBytes

public byte[] asciiGetBytes()
Return a textual representation of this header, encoded into bytes with US-ASCII encoding.
Returns:
The header text.

parseFirstLine

protected void parseFirstLine(java.lang.String line)
Overrides:
parseFirstLine in class HttpHeaderAscii

main

public static void main(java.lang.String[] argv)