| java.lang.Object org.w3c.www.mime.MimeHeaders
MimeHeaders | public class MimeHeaders implements MimeHeaderHolder(Code) | | 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.
|
Method Summary | |
public void | dump(PrintStream out) Dump all headers to the given stream. | public Enumeration | enumerateHeaders() Enumerate the headers defined by the holder. | public InputStream | getInputStream() Get the entity stream attached to these headers, if any. | public String | getValue(String name) Retreive a header value.
Parameters: name - The name of the header. | public boolean | notifyBeginParsing(MimeParser parser) 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. | public void | notifyEndParsing(MimeParser parser) All the headers have been parsed, take any appropriate actions. | public void | notifyHeader(String name, byte buf, int off, int len) A new header has been parsed. | public void | setValue(String name, String value) Set a header value. |
MimeHeaders | public MimeHeaders()(Code) | | |
dump | public void dump(PrintStream out)(Code) | | Dump all headers to the given stream.
Parameters: out - The stream to dump to. |
enumerateHeaders | public Enumeration enumerateHeaders()(Code) | | Enumerate the headers defined by the holder.
A enumeration of header names, or null if noheader is defined. |
getInputStream | public InputStream getInputStream()(Code) | | Get the entity stream attached to these headers, if any.
An InputStream instance, or null if noentity available. |
getValue | public String getValue(String name)(Code) | | Retreive a header value.
Parameters: name - The name of the header. The value for this header, or null if undefined. |
notifyBeginParsing | public boolean notifyBeginParsing(MimeParser parser) throws IOException(Code) | | 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. A boolean true if the MimeParser shouldn'tcontinue the parsing, false otherwise. exception: IOException - if an IO error occurs. |
notifyEndParsing | public void notifyEndParsing(MimeParser parser) throws IOException(Code) | | All the headers have been parsed, take any appropriate actions.
Parameters: parser - The Mime parser. exception: IOException - if an IO error occurs. |
notifyHeader | public void notifyHeader(String name, byte buf, int off, int len) throws MimeParserException(Code) | | A new header has been parsed.
Parameters: name - The name of the encountered header. Parameters: buf - The byte buffer containing the value. Parameters: off - Offset of the header value in the above buffer. Parameters: len - Length of the value in the above header. exception: MimeParserException - if the parsing failed |
setValue | public void setValue(String name, String value)(Code) | | Set a header value.
Parameters: name - The header name. Parameters: value - The header value. |
|
|