    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class org.w3c.www.mime.MimeHeaders

    java.lang.Object
       |
       +----org.w3c.www.mime.MimeHeaders

public class MimeHeaders
extends Object
implements MimeHeaderHolder

The most stupid MIME header holder. This class uses a hashtable mapping header names (as String), to header values (as String). Header names are lowered before entering the hashtable.

##

MimeHeaders()
MimeHeaders(MimeParser)

##

dump(PrintStream)
  Dump all headers to the given stream.
enumerateHeaders()
  Enumerate the headers defined by the holder.
getInputStream()
  Get the entity stream attached to these headers, if any.
getValue(String)
  Retreive a header value.
notifyBeginParsing(MimeParser)
  The parsing is now about to start, take any appropriate action.
notifyEndParsing(MimeParser)
  All the headers have been parsed, take any appropriate actions.
notifyHeader(String, byte[], int, int)
  A new header has been parsed.
setValue(String, String)
  Set a header value.

##

MimeHeaders

     public MimeHeaders(MimeParser parser)

MimeHeaders

     public MimeHeaders()

##

notifyHeader

     public void notifyHeader(String name,
                              byte buf[],
                              int off,
                              int len) throws MimeParserException

  A new header has been parsed.

  Parameters:
    name - The name of the encountered header.
    buf - The byte buffer containing the value.
    off - Offset of the header value in the above buffer.
    len - Length of the value in the above header.

notifyBeginParsing

     public boolean notifyBeginParsing(MimeParser parser) throws IOException

  The parsing is now about to start, take any appropriate action. This hook can return a true boolean value to enforce the MIME parser into transparent mode (eg the parser will not try to parse any headers.

  This hack is primarily defined for HTTP/0.9 support, it might also be usefull for other hacks.

  Parameters:
    parser - The Mime parser.
  Returns:
    A boolean true if the MimeParser shouldn't continue the parsing, false otherwise.

notifyEndParsing

     public void notifyEndParsing(MimeParser parser) throws IOException

  All the headers have been parsed, take any appropriate actions.

  Parameters:
    parser - The Mime parser.

setValue

     public void setValue(String name,
                          String value)

  Set a header value.

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

getValue

     public String getValue(String name)

  Retreive a header value.

  Parameters:
    name - The name of the header.
  Returns:
    The value for this header, or null if undefined.

enumerateHeaders

     public Enumeration enumerateHeaders()

  Enumerate the headers defined by the holder.

  Returns:
    A enumeration of header names, or null if no header is defined.

getInputStream

     public InputStream getInputStream()

  Get the entity stream attached to these headers, if any.

  Returns:
    An InputStream instance, or null if no entity available.

dump

     public void dump(PrintStream out)

  Dump all headers to the given stream.

  Parameters:
    out - The stream to dump to.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index