|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.w3c.www.mime.MimeHeaders
public class MimeHeaders
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.
Constructor Summary | |
---|---|
MimeHeaders()
|
|
MimeHeaders(MimeParser parser)
|
Method Summary | |
---|---|
void |
dump(java.io.PrintStream out)
Dump all headers to the given stream. |
java.util.Enumeration |
enumerateHeaders()
Enumerate the headers defined by the holder. |
java.io.InputStream |
getInputStream()
Get the entity stream attached to these headers, if any. |
java.lang.String |
getValue(java.lang.String name)
Retreive a header value. |
boolean |
notifyBeginParsing(MimeParser parser)
The parsing is now about to start, take any appropriate action. |
void |
notifyEndParsing(MimeParser parser)
All the headers have been parsed, take any appropriate actions. |
void |
notifyHeader(java.lang.String name,
byte[] buf,
int off,
int len)
A new header has been parsed. |
void |
setValue(java.lang.String name,
java.lang.String value)
Set a header value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MimeHeaders(MimeParser parser)
public MimeHeaders()
Method Detail |
---|
public void notifyHeader(java.lang.String name, byte[] buf, int off, int len) throws MimeParserException
notifyHeader
in interface MimeHeaderHolder
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.
MimeParserException
- if the parsing failedpublic boolean notifyBeginParsing(MimeParser parser) throws java.io.IOException
This hack is primarily defined for HTTP/0.9 support, it might also be usefull for other hacks.
notifyBeginParsing
in interface MimeHeaderHolder
parser
- The Mime parser.
java.io.IOException
- if an IO error occurs.public void notifyEndParsing(MimeParser parser) throws java.io.IOException
notifyEndParsing
in interface MimeHeaderHolder
parser
- The Mime parser.
java.io.IOException
- if an IO error occurs.public void setValue(java.lang.String name, java.lang.String value)
name
- The header name.value
- The header value.public java.lang.String getValue(java.lang.String name)
name
- The name of the header.
public java.util.Enumeration enumerateHeaders()
public java.io.InputStream getInputStream()
public void dump(java.io.PrintStream out)
out
- The stream to dump to.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |