|
Préférences
Moteurs de recherche
|
||||||||||||||||||||||||||||||||||||
JavaTM Platform, Enterprise Edition, v 5.0
javax.mail.internet
|
Field Summary |
---|
Fields inherited from interface javax.mail.Part |
---|
ATTACHMENT, INLINE |
Method Summary | |
---|---|
void |
addHeaderLine(String line)
Add a raw RFC822 header-line. |
Enumeration |
getAllHeaderLines()
Get all header lines as an Enumeration of Strings. |
String |
getContentID()
Get the Content-ID of this part. |
String[] |
getContentLanguage()
Get the language tags specified in the Content-Language header of this MimePart. |
String |
getContentMD5()
Get the Content-MD5 digest of this part. |
String |
getEncoding()
Get the transfer encoding of this part. |
String |
getHeader(String 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. |
void |
setText(String text,
String charset,
String subtype)
Convenience method that sets the given String as this part's content, with a primary MIME type of "text" and the specified MIME subtype. |
Methods inherited from interface javax.mail.Part |
---|
addHeader, getAllHeaders, getContent, getContentType, getDataHandler, getDescription, getDisposition, getFileName, getHeader, getInputStream, getLineCount, getMatchingHeaders, getNonMatchingHeaders, getSize, isMimeType, removeHeader, setContent, setContent, setDataHandler, setDescription, setDisposition, setFileName, setHeader, writeTo |
Method Detail |
---|
String getHeader(String name, String delimiter) throws MessagingException
null
, only the
first value is returned.
name
- the name of this headerdelimiter
- delimiter between fields in returned string
MessagingException
void addHeaderLine(String line) throws MessagingException
IllegalWriteException
- if the underlying
implementation does not support modification
IllegalStateException
- if this Part is
obtained from a READ_ONLY folder
MessagingException
Enumeration getAllHeaderLines() throws MessagingException
MessagingException
Enumeration getMatchingHeaderLines(String[] names) throws MessagingException
MessagingException
Enumeration getNonMatchingHeaderLines(String[] names) throws MessagingException
MessagingException
String getEncoding() throws MessagingException
MessagingException
String getContentID() throws MessagingException
MessagingException
String getContentMD5() throws MessagingException
MessagingException
void setContentMD5(String md5) throws MessagingException
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
String[] getContentLanguage() throws MessagingException
null
if this header is not
available.
MessagingException
void setContentLanguage(String[] languages) throws MessagingException
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
void setText(String text) throws MessagingException
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 occurssetText(String text, String charset)
void setText(String text, String charset) throws MessagingException
text
- the text content to setcharset
- the charset to use for the text
MessagingException
- if an error occursvoid setText(String text, String charset, String subtype) throws MessagingException
text
- the text content to setcharset
- the charset to use for the textsubtype
- the MIME subtype to use (e.g., "html")
MessagingException
- if an error occurs