|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectjavax.mail.internet.InternetHeaders
A collection of RFC 822 headers.
The string representation of RFC822 and MIME header fields must contain
only US-ASCII characters. Non US-ASCII characters must be encoded as per
the rules in RFC 2047. This class does not enforce those rules; the
caller is expected to use MimeUtility to ensure that header
values are correctly encoded.
| Constructor Summary | |
|---|---|
InternetHeaders()
Constructor for an empty InternetHeaders. |
|
InternetHeaders(java.io.InputStream is)
Constructor with an RFC 822 message stream. |
|
| Method Summary | |
|---|---|
void |
addHeader(java.lang.String name,
java.lang.String value)
Adds the specified header. |
void |
addHeaderLine(java.lang.String line)
Adds an RFC 822 header-line to this InternetHeaders. |
java.util.Enumeration |
getAllHeaderLines()
Returns all the header-lines. |
java.util.Enumeration |
getAllHeaders()
Returns all the headers. |
java.lang.String[] |
getHeader(java.lang.String name)
Returns all the values for the specified header. |
java.lang.String |
getHeader(java.lang.String name,
java.lang.String delimiter)
Returns all the headers for this header name as a single string, with headers separated by the given delimiter. |
java.util.Enumeration |
getMatchingHeaderLines(java.lang.String[] names)
Returns all the header-lines with any of the given names. |
java.util.Enumeration |
getMatchingHeaders(java.lang.String[] names)
Returns all the headers with any of the given names. |
java.util.Enumeration |
getNonMatchingHeaderLines(java.lang.String[] names)
Returns all the header-lines without any of the given names. |
java.util.Enumeration |
getNonMatchingHeaders(java.lang.String[] names)
Returns all the headers without any of the given names. |
void |
load(java.io.InputStream is)
Parses the specified RFC 822 message stream, storing the headers in this InternetHeaders. |
void |
removeHeader(java.lang.String name)
Removes all headers matching the given name. |
void |
setHeader(java.lang.String name,
java.lang.String value)
Sets the specified header. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public InternetHeaders()
public InternetHeaders(java.io.InputStream is)
throws MessagingException
is - an RFC 822 input stream| Method Detail |
public void load(java.io.InputStream is)
throws MessagingException
is - an RFC 822 input stream
MessagingExceptionpublic java.lang.String[] getHeader(java.lang.String name)
name - the header name
public java.lang.String getHeader(java.lang.String name,
java.lang.String delimiter)
null, only the first header is returned.
name - the header namedelimiter - the delimiter
public void setHeader(java.lang.String name,
java.lang.String value)
name - the header namevalue - the header value
public void addHeader(java.lang.String name,
java.lang.String value)
name - the header namevalue - the header valuepublic void removeHeader(java.lang.String name)
name - the header namepublic java.util.Enumeration getAllHeaders()
public java.util.Enumeration getMatchingHeaders(java.lang.String[] names)
names - the names to match
public java.util.Enumeration getNonMatchingHeaders(java.lang.String[] names)
names - the names not to match
public void addHeaderLine(java.lang.String line)
line - the raw RFC 822 header-linepublic java.util.Enumeration getAllHeaderLines()
public java.util.Enumeration getMatchingHeaderLines(java.lang.String[] names)
public java.util.Enumeration getNonMatchingHeaderLines(java.lang.String[] names)
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||