Enhydra 5.1 API

org.enhydra.servlet.connectionMethods.https
Class HttpsHeaders

java.lang.Object
  |
  +--org.enhydra.servlet.connectionMethods.https.HttpsHeaders

public class HttpsHeaders
extends java.lang.Object

Class to store headers. This stores either a header or an array of headers, Depending if one or more instances of a header has been encountered. A hash table is not kept, as the order of writing headers seems to tickle bugs in certain browsers.


Constructor Summary
HttpsHeaders()
           
 
Method Summary
protected  void add(java.lang.String hname, java.lang.String hvalue)
          Add a header.
protected  void clear()
          Clear headers.
protected  boolean exists(java.lang.String hname)
          Determine if a header exists.
protected  org.enhydra.servlet.connectionMethods.https.HttpsHeader get(java.lang.String hname)
          Search for a header in the table.
protected  int getInt(java.lang.String hname)
          Get a integer header.
 java.util.Enumeration getNames()
          Get an enumeration of the headers.
protected  java.lang.String getValue(java.lang.String hname)
          Get a header value.
 java.lang.String[] getValues(java.lang.String hname)
          Return array of header values for a header that might have been sent multiple times.
protected  void set(java.lang.String hname, java.lang.String hvalue)
          Add a header.
protected  void write(org.enhydra.servlet.connectionMethods.https.HttpsOutputStream out)
          Write headers to an output stream that have not already been written.
protected  void write(org.enhydra.servlet.connectionMethods.https.HttpsOutputStream out, java.lang.String[] headerOrder)
          Write specified headers to an output stream in the specified order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpsHeaders

public HttpsHeaders()
Method Detail

get

protected org.enhydra.servlet.connectionMethods.https.HttpsHeader get(java.lang.String hname)
Search for a header in the table.

Parameters:
hname - The name of the header to search for.
Returns:
The header object, or null if not found

add

protected void add(java.lang.String hname,
                   java.lang.String hvalue)
Add a header. If the header already exists, add a new value; otherwise create a new object.

Parameters:
hname - The header name.
hvalue - The header value.

set

protected void set(java.lang.String hname,
                   java.lang.String hvalue)
Add a header. If the header already exists, overwrite the existing value.

Parameters:
hname - The header name.
hvalue - The header value.

exists

protected boolean exists(java.lang.String hname)
Determine if a header exists.

Parameters:
hname - The header name.
Returns:
true if the header exists, false if it doesn't

getValue

protected java.lang.String getValue(java.lang.String hname)
Get a header value.

Parameters:
hname - The header name.
Returns:
The header value or null if it does not exist.

getValues

public java.lang.String[] getValues(java.lang.String hname)
Return array of header values for a header that might have been sent multiple times.

Parameters:
hname - The header name.
Returns:
The header value array or null if it does not exist.

getInt

protected int getInt(java.lang.String hname)
Get a integer header.

Parameters:
hname - The header name.
Returns:
The header value or -1 if it does not exist.
Throws:
java.lang.NumberFormatException - If value of header can't be converted to an int.

getNames

public java.util.Enumeration getNames()
Get an enumeration of the headers.

Returns:
An enumeration of HttpsHeader.

write

protected void write(org.enhydra.servlet.connectionMethods.https.HttpsOutputStream out,
                     java.lang.String[] headerOrder)
              throws java.io.IOException
Write specified headers to an output stream in the specified order.

Parameters:
headerOrder - List of headers to write in the order they are to be written.
out - Output stream to write.
Throws:
java.io.IOException - If an write error occured.

write

protected void write(org.enhydra.servlet.connectionMethods.https.HttpsOutputStream out)
              throws java.io.IOException
Write headers to an output stream that have not already been written.

Parameters:
out - Output stream to write.
Throws:
java.io.IOException - If an write error occured.

clear

protected void clear()
Clear headers.


Enhydra 5.1 API