| com.google.code.javax.mail.internet.MimePart |
Known Indirect Subclasses
|
The MimePart interface models an Entity as defined by MIME (RFC2045, Section 2.4).
MimePart extends the Part interface to add additional RFC822 and MIME specific semantics and attributes. It provides the base interface for the MimeMessage and MimeBodyPart classes
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.
MimeUtility|
[Expand]
Inherited Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.google.code.javax.mail.Part
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Add a raw RFC822 header-line.
| |||||||||||
Get all header lines as an Enumeration of Strings.
| |||||||||||
Get the Content-ID of this part.
| |||||||||||
Get the language tags specified in the Content-Language header
of this MimePart.
| |||||||||||
Get the Content-MD5 digest of this part.
| |||||||||||
Get the transfer encoding of this part.
| |||||||||||
Get the values of all header fields available for this header,
returned as a single String, with the values separated by the
delimiter.
| |||||||||||
Get matching header lines as an Enumeration of Strings.
| |||||||||||
Get non-matching header lines as an Enumeration of Strings.
| |||||||||||
Set the Content-Language header of this MimePart.
| |||||||||||
Set the Content-MD5 of this part.
| |||||||||||
Convenience method that sets the given String as this
part's content, with a MIME type of "text/plain".
| |||||||||||
Convenience method that sets the given String as this part's
content, with a primary MIME type of "text" and the specified
MIME subtype.
| |||||||||||
Convenience method that sets the given String as this part's
content, with a MIME type of "text/plain" and the specified
charset.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.google.code.javax.mail.Part
| |||||||||||
Add a raw RFC822 header-line.
| line |
|---|
| IllegalWriteException | if the underlying implementation does not support modification |
|---|---|
| IllegalStateException | if this Part is obtained from a READ_ONLY folder |
| MessagingException |
Get all header lines as an Enumeration of Strings. A Header line is a raw RFC822 header-line, containing both the "name" and "value" field.
| MessagingException |
|---|
Get the Content-ID of this part. Returns null if none present.
| MessagingException |
|---|
Get the language tags specified in the Content-Language header
of this MimePart. The Content-Language header is defined by
RFC 1766. Returns null if this header is not
available.
| MessagingException |
|---|
Get the Content-MD5 digest of this part. Returns null if none present.
| MessagingException |
|---|
Get the values of all header fields available for this header,
returned as a single String, with the values separated by the
delimiter. If the delimiter is null, only the
first value is returned.
| name | The name of this header |
|---|---|
| delimiter | Delimiter between fields in returned string |
| MessagingException |
|---|
Get matching header lines as an Enumeration of Strings. A Header line is a raw RFC822 header-line, containing both the "name" and "value" field.
| names |
|---|
| MessagingException |
|---|
Get non-matching header lines as an Enumeration of Strings. A Header line is a raw RFC822 header-line, containing both the "name" and "value" field.
| names |
|---|
| MessagingException |
|---|
Set the Content-Language header of this MimePart. The Content-Language header is defined by RFC1766.
| languages | Array of language tags |
|---|
| IllegalWriteException | if the underlying implementation does not support modification |
|---|---|
| IllegalStateException | if this Part is obtained from a READ_ONLY folder |
| MessagingException |
Set the Content-MD5 of this part.
| md5 | The MD5 value |
|---|
| IllegalWriteException | if the underlying implementation does not support modification |
|---|---|
| IllegalStateException | if this Part is obtained from a READ_ONLY folder |
| MessagingException |
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain". If the string contains non US-ASCII characters. it will be encoded using the platform's default charset. The charset is also used to set the "charset" parameter.
Note that there may be a performance penalty if
text is large, since this method may have
to scan all the characters to determine what charset to
use.
If the charset is already known, use the
setText method that takes the charset parameter.
| text | The text content to set |
|---|
| MessagingException | if an error occurs |
|---|
Convenience method that sets the given String as this part's content, with a primary MIME type of "text" and the specified MIME subtype. The given Unicode string will be charset-encoded using the specified charset. The charset is also used to set the "charset" parameter.
| text | The text content to set |
|---|---|
| charset | The charset to use for the text |
| subtype | The MIME subtype to use (e.g., "html") |
| MessagingException | if an error occurs |
|---|
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain" and the specified charset. The given Unicode string will be charset-encoded using the specified charset. The charset is also used to set "charset" parameter.
| text | The text content to set |
|---|---|
| charset | The charset to use for the text |
| MessagingException | if an error occurs |
|---|