void | addHeaderLine(String line) Add a raw RFC822 header-line. |
Enumeration | Get all header lines as an Enumeration of Strings. |
String | Get the Content-ID of this part. |
String[] | Get the language tags specified in the Content-Language header of this MimePart. |
String | Get the Content-MD5 digest of this part. |
String | Get the transfer encoding of this part. |
String | getHeader(String header_name, String delimiter) Get the values of all header fields available for this header, returned as a single String, with the values separated by the delimiter. |
Enumeration | getMatchingHeaderLines(String[] names) Get matching header lines as an Enumeration of Strings. |
Enumeration | getNonMatchingHeaderLines(String[] names) Get non-matching header lines as an Enumeration of Strings. |
void | setContentLanguage(String[] languages) Set the Content-Language header of this MimePart. |
void | setContentMD5(String md5) Set the Content-MD5 of this part. |
void | setText(String text) Convenience method that sets the given String as this part's content, with a MIME type of "text/plain". |
void | setText(String text, String charset) Convenience method that sets the given String as this part's content, with a MIME type of "text/plain" and the specified charset. |
public void addHeaderLine(String line)
- if the underlying implementation does not
support modification
- if this Part is obtained from a READ_ONLY
folderpublic Enumeration getAllHeaderLines()
public String getContentID()
public String[] getContentLanguage()
public String getContentMD5()
public String getEncoding()
public String getHeader(String header_name, String delimiter)
public Enumeration getMatchingHeaderLines(String[] names)
public Enumeration getNonMatchingHeaderLines(String[] names)
public void setContentLanguage(String[] languages)
- if the underlying implementation does not
support modification
- if this Part is obtained from a READ_ONLY
folderpublic void setContentMD5(String md5)
- if the underlying implementation does not
support modificationpublic void setText(String text)
setText()
version
that takes the charset
parameter.
public void setText(String text, String charset)
A note on RFC822 and MIME 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
, andaddHeaderLine
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.