|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
MimeUtility
,
Part
Fields inherited from interface javax.mail.Part |
ATTACHMENT, INLINE |
Method Summary | |
void |
addHeaderLine(java.lang.String line)
Add a raw RFC822 header-line. |
java.util.Enumeration |
getAllHeaderLines()
Get all header lines as an Enumeration of Strings. |
java.lang.String |
getContentID()
Get the Content-ID of this part. |
java.lang.String[] |
getContentLanguage()
Get the language tags specified in the Content-Language header of this MimePart. |
java.lang.String |
getContentMD5()
Get the Content-MD5 digest of this part. |
java.lang.String |
getEncoding()
Get the transfer encoding of this part. |
java.lang.String |
getHeader(java.lang.String header_name,
java.lang.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. |
java.util.Enumeration |
getMatchingHeaderLines(java.lang.String[] names)
Get matching header lines as an Enumeration of Strings. |
java.util.Enumeration |
getNonMatchingHeaderLines(java.lang.String[] names)
Get non-matching header lines as an Enumeration of Strings. |
void |
setContentLanguage(java.lang.String[] languages)
Set the Content-Language header of this MimePart. |
void |
setContentMD5(java.lang.String md5)
Set the Content-MD5 of this part. |
void |
setText(java.lang.String text)
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain". |
void |
setText(java.lang.String text,
java.lang.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. |
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 |
public java.lang.String getHeader(java.lang.String header_name, java.lang.String delimiter) throws MessagingException
null
, only the
first value is returned.header_name
- the name of this headerMessagingException
- public void addHeaderLine(java.lang.String line) throws MessagingException
IllegalWriteException
- if the underlying
implementation does not support modificationjava.lang.IllegalStateException
- if this Part is
obtained from a READ_ONLY folderpublic java.util.Enumeration getAllHeaderLines() throws MessagingException
public java.util.Enumeration getMatchingHeaderLines(java.lang.String[] names) throws MessagingException
public java.util.Enumeration getNonMatchingHeaderLines(java.lang.String[] names) throws MessagingException
public java.lang.String getEncoding() throws MessagingException
MessagingException
- public java.lang.String getContentID() throws MessagingException
public java.lang.String getContentMD5() throws MessagingException
public void setContentMD5(java.lang.String md5) throws MessagingException
cid
- content-idIllegalWriteException
- if the underlying
implementation does not support modificationjava.lang.IllegalStateException
- if this Part is
obtained from a READ_ONLY folderpublic java.lang.String[] getContentLanguage() throws MessagingException
null
if this header is not
available.public void setContentLanguage(java.lang.String[] languages) throws MessagingException
languages
- array of language tagsIllegalWriteException
- if the underlying
implementation does not support modificationjava.lang.IllegalStateException
- if this Part is
obtained from a READ_ONLY folderpublic void setText(java.lang.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() version that takes the charset parameter.
setText(String text, String charset)
public void setText(java.lang.String text, java.lang.String charset) throws MessagingException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |