All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.servlet.http.MimeHeaderField

java.lang.Object
   |
   +----sun.servlet.http.MimeHeaderField

public class MimeHeaderField
extends Object
This class is used to represent a MIME header field.


Variable Index

 o dateValue
The header field Date value.
 o intValue
The header field integer value.
 o name
The header field name.
 o T_DATE
 o T_INT
 o T_NULL
 o T_STR
 o type
The header field value type.
 o value
The header field value.

Constructor Index

 o MimeHeaderField()
Creates a new, uninitialized header field.

Method Index

 o getDateValue()
Returns the date value of the header field.
 o getIntValue()
Returns the integer value of the header field.
 o getName()
Returns the header field name as a String.
 o getValue()
Returns the header field value as a String, or null if not set.
 o nameEquals(byte[], int, int)
Returns true if the header field has the specified name.
 o nameEquals(String)
Returns true if the header field has the specified name.
 o parse(byte[], int, int)
Parses a header field from a subarray of bytes.
 o reset()
Resets the header field to an uninitialized state.
 o setDateValue()
Sets the header field date value to the current time.
 o setDateValue(long)
Sets the header field date value to the specified time.
 o setIntValue(int)
Sets the header field to the specified integer value.
 o setName(byte[], int, int)
Sets the header field name to the specified subarray of bytes.
 o setName(String)
Sets the header field name to the specified string.
 o setValue(byte[], int, int)
Sets the header field value to the specified subarray of bytes.
 o setValue(String)
Sets the header field value to the specified string.
 o toString()
Returns a string representation of the header field.
 o write(ServletOutputStream)
Writes this header field to the specified servlet output stream.

Variables

 o name
  protected final MessageString name
The header field name.

 o value
  protected final MessageString value
The header field value.

 o intValue
  protected int intValue
The header field integer value.

 o dateValue
  protected final HttpDate dateValue
The header field Date value.

 o type
  protected int type
The header field value type.

 o T_NULL
  protected final static int T_NULL
 o T_STR
  protected final static int T_STR
 o T_INT
  protected final static int T_INT
 o T_DATE
  protected final static int T_DATE

Constructors

 o MimeHeaderField
  public MimeHeaderField()
Creates a new, uninitialized header field.

Methods

 o reset
  public void reset()
Resets the header field to an uninitialized state.

 o setName
  public void setName(String s)
Sets the header field name to the specified string.

Parameters:
s - the header field name String
 o setName
  public void setName(byte b[],
                      int off,
                      int len)
Sets the header field name to the specified subarray of bytes.

Parameters:
b - the header field name bytes
off - the start offset of the bytes
len - the length of the bytes
 o setValue
  public void setValue(String s)
Sets the header field value to the specified string.

Parameters:
s - the header field value String
 o setValue
  public void setValue(byte b[],
                       int off,
                       int len)
Sets the header field value to the specified subarray of bytes.

Parameters:
b - the header field value bytes
off - the start offset of the bytes
len - the length of the bytes
 o setIntValue
  public void setIntValue(int i)
Sets the header field to the specified integer value.

Parameters:
i - the header field integer value
 o setDateValue
  public void setDateValue(long t)
Sets the header field date value to the specified time.

Parameters:
t - the time in milliseconds since the epoch
 o setDateValue
  public void setDateValue()
Sets the header field date value to the current time.

 o getName
  public String getName()
Returns the header field name as a String.

 o getValue
  public String getValue()
Returns the header field value as a String, or null if not set.

 o getIntValue
  public int getIntValue() throws NumberFormatException
Returns the integer value of the header field.

Throws: NumberFormatException
if the integer format was invalid
 o getDateValue
  public long getDateValue() throws IllegalArgumentException
Returns the date value of the header field.

Returns:
the header date value in number of milliseconds since the epoch
Throws: IllegalArgumentException
if the date format was invalid
 o parse
  public void parse(byte b[],
                    int off,
                    int len) throws IllegalArgumentException
Parses a header field from a subarray of bytes.

Parameters:
b - the bytes to parse
off - the start offset of the bytes
len - the length of the bytes
Throws: IllegalArgumentException
if the header format was invalid
 o write
  public void write(ServletOutputStream out) throws IOException
Writes this header field to the specified servlet output stream.

 o nameEquals
  public boolean nameEquals(String s)
Returns true if the header field has the specified name. Character case is ignored in the comparison.

Parameters:
s - the string to compare
 o nameEquals
  public boolean nameEquals(byte b[],
                            int off,
                            int len)
Returns true if the header field has the specified name. Character case is ignored in the comparison.

Parameters:
b - the bytes to compare
off - the start offset of the bytes
len - the length of the bytes
 o toString
  public String toString()
Returns a string representation of the header field.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index