java.lang.ObjectInternetHeaders is a utility class that manages RFC822 style headers. Given an RFC822 format message stream, it reads lines until the blank line that indicates end of header. The input stream is positioned at the start of the body. The lines are stored within the object and can be extracted as either Strings or javax.mail.Header objects.javax.mail.internet.InternetHeaders
This class is mostly intended for service providers. MimeMessage and MimeBody use this class for holding their headers.
RFC822 and MIME header fields must contain only
US-ASCII characters. If a header contains non US-ASCII characters,
it must be encoded as per the rules in RFC 2047. The MimeUtility
class provided in this package can be used to to achieve this.
Callers of the setHeader
, addHeader
, and
addHeaderLine
methods are responsible for enforcing
the MIME requirements for the specified headers. In addition, these
header fields must be folded (wrapped) before being sent if they
exceed the line length limitation for the transport (1000 bytes for
SMTP). Received headers may have been folded. The application is
responsible for folding and unfolding headers as appropriate.
John
- ManiBill
- ShannonNested Class Summary: | ||
---|---|---|
protected static final class | InternetHeaders.InternetHeader | An individual internet header. This class is only used by
subclasses of InternetHeaders. An InternetHeader object with a null value is used as a placeholder for headers of that name, to preserve the order of headers. A placeholder InternetHeader object with a name of ":" marks the location in the list of headers where new headers are added by default. |
static class | InternetHeaders.matchEnum |
Field Summary | ||
---|---|---|
protected List | headers | The actual list of Headers, including placeholder entries.
Placeholder entries are Headers with a null value and
are never seen by clients of the InternetHeaders class.
Placeholder entries are used to keep track of the preferred
order of headers. Headers are never actually removed from
the list, they're converted into placeholder entries.
New headers are added after existing headers of the same name
(or before in the case of Received and
Return-Path headers). If no existing header
or placeholder for the header is found, new headers are
added after the special placeholder with the name ":".
|
Method from javax.mail.internet.InternetHeaders Summary: |
---|
addHeader, addHeaderLine, getAllHeaderLines, getAllHeaders, getHeader, getHeader, getMatchingHeaderLines, getMatchingHeaders, getNonMatchingHeaderLines, getNonMatchingHeaders, load, removeHeader, setHeader |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from javax.mail.internet.InternetHeaders Detail: |
---|
The current implementation knows about the preferred order of most
well-known headers and will insert headers in that order. In
addition, it knows that Note that RFC822 headers can only contain US-ASCII characters. |
Note that RFC822 headers can only contain US-ASCII characters |
|
|
null
if no headers with the specified name exist. |
null , only the first header is
returned. Returns null
if no headers with the specified name exist. |
|
|
|
|
Note that the header lines are added into this InternetHeaders object, so any existing headers in this object will not be affected. Headers are added to the end of the existing list of headers, in order. |
|
Note that RFC822 headers can only contain US-ASCII characters |