|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MimePart
A MIME part is an Entity as defined by MIME (RFC2045, Section 2.4).
The string representation of RFC822 and MIME header fields must contain
only US-ASCII characters. Non US-ASCII characters must be encoded as per
the rules in RFC 2047. This class does not enforce those rules; the
caller is expected to use MimeUtility
to ensure that header
values are correctly encoded.
Field Summary |
---|
Fields inherited from interface javax.mail.Part |
---|
ATTACHMENT, INLINE |
Method Summary | |
---|---|
void |
addHeaderLine(java.lang.String line)
Adds an RFC822 header-line. |
java.util.Enumeration |
getAllHeaderLines()
Returns all the header-lines. |
java.lang.String |
getContentID()
Returns the value of the Content-ID header field of this part. |
java.lang.String[] |
getContentLanguage()
Returns the languages specified in the Content-Language header of this part, as defined by RFC 1766. |
java.lang.String |
getContentMD5()
Returns the value of the Content-MD5 header field of this part. |
java.lang.String |
getEncoding()
Returns the value of the Content-Transfer-Encoding header field of this part. |
java.lang.String |
getHeader(java.lang.String header_name,
java.lang.String delimiter)
Returns the values of all header fields for the specified name, returned as a single String with the values separated by the given delimiter. |
java.util.Enumeration |
getMatchingHeaderLines(java.lang.String[] names)
Returns all the header-lines with any of the given names. |
java.util.Enumeration |
getNonMatchingHeaderLines(java.lang.String[] names)
Returns all the header-lines without any of the given names. |
void |
setContentLanguage(java.lang.String[] languages)
Sets the Content-Language header of this part. |
void |
setContentMD5(java.lang.String md5)
Sets the Content-MD5 header value for this part. |
void |
setText(java.lang.String text)
Sets the content of this message using the specified text, and with a MIME type of "text/plain". |
void |
setText(java.lang.String text,
java.lang.String charset)
Sets the content of this message using the specified text, and with a MIME type of "text/plain". |
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 |
---|
java.lang.String getHeader(java.lang.String header_name, java.lang.String delimiter) throws MessagingException
header_name
- the header name
MessagingException
void addHeaderLine(java.lang.String line) throws MessagingException
IllegalWriteException
- if the underlying implementation does not
support modification
java.lang.IllegalStateException
- if this part is obtained from a READ_ONLY
folder
MessagingException
java.util.Enumeration getAllHeaderLines() throws MessagingException
MessagingException
java.util.Enumeration getMatchingHeaderLines(java.lang.String[] names) throws MessagingException
MessagingException
java.util.Enumeration getNonMatchingHeaderLines(java.lang.String[] names) throws MessagingException
MessagingException
java.lang.String getEncoding() throws MessagingException
MessagingException
java.lang.String getContentID() throws MessagingException
MessagingException
java.lang.String getContentMD5() throws MessagingException
MessagingException
void setContentMD5(java.lang.String md5) throws MessagingException
IllegalStateException
- if this part is obtained from a READ_ONLY
folder
IllegalWriteException
- if the underlying implementation does not
support modification
MessagingException
java.lang.String[] getContentLanguage() throws MessagingException
null
if
this header is not available.
MessagingException
void setContentLanguage(java.lang.String[] languages) throws MessagingException
languages
- the array of language tags
IllegalWriteException
- if the underlying implementation does not
support modification
java.lang.IllegalStateException
- if this Part is obtained from a READ_ONLY
folder
MessagingException
void setText(java.lang.String text) throws MessagingException
If the string contains non US-ASCII characters, it will be encoded using the platform default charset.
setText
in interface Part
text
- the text content
IllegalWriteException
- if the underlying implementation
does not support modification
MessagingException
void setText(java.lang.String text, java.lang.String charset) throws MessagingException
If the string contains non US-ASCII characters, it will be encoded using the specified charset.
text
- the text contentcharset
- the charset to use for any encoding
MessagingException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |