Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rabbit.http
Class HTTPHeader

    java.lang.Object
      rabbit.http.GeneralHeader
          rabbit.http.HTTPHeader

All Implemented Interfaces:
  java.io.Externalizable, java.io.Serializable

    public class HTTPHeader

extends GeneralHeader

A class to handle a HTTPHeader.

See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class rabbit.http.GeneralHeader
`GeneralHeader.Header`

Field Summary

Fields inherited from class rabbit.http.GeneralHeader
`CRLF, headerCache, headers, strictHTTP`

Constructor Summary
`HTTPHeader()` Create a new HTTPHeader from scratch
`HTTPHeader(java.io.DataInputStream in)` Read in a HTTPHeader from an inputstream.

Method Summary
`boolean` | `equals(java.lang.Object o)` Is this Header equal to the other object? Two HTTPHeaders are assumed equal if the requesURI's are equal.
`java.lang.String` | `getContent()` Get the content of the request/response.
`byte[]` | `getContentArr()`
`HTTPInputStream` | `getContentStream()`
`java.lang.String` | `getHTTPVersion()` Get the HTTP Version of this request (only valid for requests).
`java.lang.String` | `getMethod()` Get the request method of this header (only valid for requests).
`java.lang.String` | `getReasonPhrase()` Get the Reason phrase of the response (only valid for responses).
`java.lang.String` | `getRequestLine()` Get the requestline of this header (only valid for requests).
`java.lang.String` | `getRequestURI()` Get the requestURI of this request (only valid for requests).
`java.lang.String` | `getResponseHTTPVersion()` Get the HTTP version of the response (only valid for responses).
`java.lang.String` | `getStatusCode()` Get the Status code of the response (only valid for responses).
`java.lang.String` | `getStatusLine()` Get the statusline of this header (only valid for responses).
`int` | `hashCode()` Get the hashCode for this header.
`boolean` | `isDot9Request()` Is this request a HTTP/0.9 type request? A 0.9 request doesnt have a full HTTPheader, only a requestline so we need to treat it differently.
`boolean` | `isHeadOnlyRequest()` Is this request for the head only?
`boolean` | `isRequest()` Try to guess if this header is a request.
`boolean` | `isResponse()` Try to guess if this header is a response.
`boolean` | `isSecure()` Try to guess if this header is a secure thing.
`void` | `readExternal(java.io.ObjectInput in)`
`void` | `readHTTPHeader(java.io.DataInputStream in)`
`void` | `setContent(byte[] content)`
`void` | `setContent(java.lang.String content)` Set the Content for the request/response Mostly not used for responses.
`void` | `setContentStream(HTTPInputStream in)` Set the content for the request/response This is a way to set up handling of a chunked input request As a side effect the "Transer-Encoding" header is also set.
`void` | `setHTTPVersion(java.lang.String version)` Set the HTTP Version to use for request.
`void` | `setMehtod(java.lang.String method)` Sets the request method of this header
`void` | `setReasonPhrase(java.lang.String reason)` Set the reason phrase for this reqponse.
`void` | `setRequestLine(java.lang.String line)` Set the requestline of this header
`void` | `setRequestURI(java.lang.String requestURI)` Sets the request URI of this header
`void` | `setResponseHTTPVersion(java.lang.String httpVersion)` Set the HTTP version for this response.
`void` | `setStatusCode(java.lang.String status)` Set the Status code for this response.
`void` | `setStatusLine(java.lang.String line)` Set the statusline of this header.
`java.lang.String` | `toString()` get the text value of this header
`void` | `writeExternal(java.io.ObjectOutput out)`

Methods inherited from class rabbit.http.GeneralHeader
`addHeader, copyHeader, getCachedString, getHeader, getHeaders, readHeader, readHeader, readLine, removeHeader, removeValue, setExistingValue, setHeader, setStrictHTTP`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### HTTPHeader

    public HTTPHeader()

  Create a new HTTPHeader from scratch

### HTTPHeader

    public HTTPHeader(java.io.DataInputStream in)
               throws java.io.IOException

  Read in a HTTPHeader from an inputstream.

  Parameters:
    `in` - the stream from which this header is read.
  Throws:
    `java.io.IOException` - if reading from in results in exceptions.

Method Detail

### readHTTPHeader

    public void readHTTPHeader(java.io.DataInputStream in)
                        throws java.io.IOException

  Throws:
    `java.io.IOException`

### toString

    public java.lang.String toString()

  get the text value of this header

  Overrides:
    `toString` in class `GeneralHeader`
  Returns:
    a String describing this HTTP-Header.

### getStatusLine

    public java.lang.String getStatusLine()

  Get the statusline of this header (only valid for responses).

  Returns:
    the status of the request.

### setStatusLine

    public void setStatusLine(java.lang.String line)

  Set the statusline of this header.

  Parameters:
    `line` - a Status-Line )RFC 2068: 6.1)

### getRequestLine

    public java.lang.String getRequestLine()

  Get the requestline of this header (only valid for requests).

  Returns:
    the request.

### setRequestLine

    public void setRequestLine(java.lang.String line)

  Set the requestline of this header

  Parameters:
    `line` - a Request-Line (RFC 2068: 5.1)

### isHeadOnlyRequest

    public boolean isHeadOnlyRequest()

  Is this request for the head only?

  Returns:
    true if this request is for HEAD, false otherwise

### getMethod

    public java.lang.String getMethod()

  Get the request method of this header (only valid for requests).

  Returns:
    the request method.

### setMehtod

    public void setMehtod(java.lang.String method)

  Sets the request method of this header

  Parameters:
    `method` - the new requestmethod

### getRequestURI

    public java.lang.String getRequestURI()

  Get the requestURI of this request (only valid for requests).

  Returns:
    the requestURI.

### setRequestURI

    public void setRequestURI(java.lang.String requestURI)

  Sets the request URI of this header

  Parameters:
    `requestURI` - the new URI

### getHTTPVersion

    public java.lang.String getHTTPVersion()

  Get the HTTP Version of this request (only valid for requests).

  Returns:
    the http version.

### setHTTPVersion

    public void setHTTPVersion(java.lang.String version)

  Set the HTTP Version to use for request.

  Parameters:
    `version` - the version to use.

### getResponseHTTPVersion

    public java.lang.String getResponseHTTPVersion()

  Get the HTTP version of the response (only valid for responses).

  Returns:
    the HTTP version.

### setResponseHTTPVersion

    public void setResponseHTTPVersion(java.lang.String httpVersion)

  Set the HTTP version for this response.

  Parameters:
    `httpVersion` - the version to use.

### getStatusCode

    public java.lang.String getStatusCode()

  Get the Status code of the response (only valid for responses).

  Returns:
    the status code.

### setStatusCode

    public void setStatusCode(java.lang.String status)

  Set the Status code for this response.

  Parameters:
    `status` - the new status code.

### getReasonPhrase

    public java.lang.String getReasonPhrase()

  Get the Reason phrase of the response (only valid for responses).

  Returns:
    the reason phrase.

### setReasonPhrase

    public void setReasonPhrase(java.lang.String reason)

  Set the reason phrase for this reqponse.

  Parameters:
    `reason` - the new reasonphrase

### setContent

    public void setContent(java.lang.String content)

  Set the Content for the request/response Mostly not used for responses. As a side effect the "Content-Length" header is also set.

  Parameters:
    `content` - the binary content.

### setContent

    public void setContent(byte[] content)

### setContentStream

    public void setContentStream(HTTPInputStream in)

  Set the content for the request/response This is a way to set up handling of a chunked input request As a side effect the "Transer-Encoding" header is also set.

  Parameters:
    `in` - the binary content.

### getContentStream

    public HTTPInputStream getContentStream()

### getContent

    public java.lang.String getContent()

  Get the content of the request/response.

### getContentArr

    public byte[] getContentArr()

### isDot9Request

    public boolean isDot9Request()

  Is this request a HTTP/0.9 type request? A 0.9 request doesnt have a full HTTPheader, only a requestline so we need to treat it differently.

### hashCode

    public int hashCode()

  Get the hashCode for this header.

  Overrides:
    `hashCode` in class `java.lang.Object`
  Returns:
    the hash code for this object.

### equals

    public boolean equals(java.lang.Object o)

  Is this Header equal to the other object? Two HTTPHeaders are assumed equal if the requesURI's are equal.

  Overrides:
    `equals` in class `java.lang.Object`
  Parameters:
    `o` - the Object to compare to.
  Returns:
    true if o and this object are equal, false otherwise.

### isRequest

    public boolean isRequest()

  Try to guess if this header is a request.

  Returns:
    true if this (probably) is a request, false otherwise.

### isResponse

    public boolean isResponse()

  Try to guess if this header is a response.

  Returns:
    true if this (probably) is a response, false otherwise.

### isSecure

    public boolean isSecure()

  Try to guess if this header is a secure thing.

  Returns:
    true if this (probably) is a secure connection.

### readExternal

    public void readExternal(java.io.ObjectInput in)
                      throws java.io.IOException,
                             java.lang.ClassNotFoundException

  Specified by:
    `readExternal` in interface `java.io.Externalizable`
  Overrides:
    `readExternal` in class `GeneralHeader`
  Throws:
    `java.io.IOException`
    `java.lang.ClassNotFoundException`

### writeExternal

    public void writeExternal(java.io.ObjectOutput out)
                       throws java.io.IOException

  Specified by:
    `writeExternal` in interface `java.io.Externalizable`
  Overrides:
    `writeExternal` in class `GeneralHeader`
  Throws:
    `java.io.IOException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD