| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
content
This message's content (unless sourced from a SharedInputStream).
|
protected InputStream |
contentStream
If the data for this message was supplied by a
SharedInputStream
then this is another such stream representing the content of this message;
if this field is non-null, then content will be null. |
protected javax.activation.DataHandler |
dh
The
DataHandler for this Message's content. |
protected InternetHeaders |
headers
This message's headers.
|
ATTACHMENT, INLINE| Constructor and Description |
|---|
MimeBodyPart() |
MimeBodyPart(InputStream in) |
MimeBodyPart(InternetHeaders headers,
byte[] content) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(String name,
String value) |
void |
addHeaderLine(String line) |
Enumeration |
getAllHeaderLines() |
Enumeration |
getAllHeaders() |
Object |
getContent() |
String |
getContentID()
Retrieve the value of the "Content-ID" header.
|
String[] |
getContentLanguage() |
String |
getContentMD5() |
protected InputStream |
getContentStream() |
String |
getContentType() |
javax.activation.DataHandler |
getDataHandler() |
String |
getDescription() |
String |
getDisposition()
Retrieve the message "Content-Disposition" header field.
|
String |
getEncoding()
Retrieves the current value of the "Content-Transfer-Encoding"
header.
|
String |
getFileName() |
String[] |
getHeader(String name) |
String |
getHeader(String name,
String delimiter) |
InputStream |
getInputStream() |
int |
getLineCount() |
Enumeration |
getMatchingHeaderLines(String[] names) |
Enumeration |
getMatchingHeaders(String[] name) |
Enumeration |
getNonMatchingHeaderLines(String[] names) |
Enumeration |
getNonMatchingHeaders(String[] name) |
InputStream |
getRawInputStream() |
int |
getSize()
Return the content size of this message.
|
boolean |
isMimeType(String type)
Tests to see if this message has a mime-type match with the
given type name.
|
void |
removeHeader(String name) |
void |
setContent(Multipart part) |
void |
setContent(Object content,
String type) |
void |
setContentID(String cid) |
void |
setContentLanguage(String[] languages) |
void |
setContentMD5(String md5) |
void |
setDataHandler(javax.activation.DataHandler handler) |
void |
setDescription(String description) |
void |
setDescription(String description,
String charset) |
void |
setDisposition(String disposition)
Set a new dispostion value for the "Content-Disposition" field.
|
void |
setFileName(String name) |
void |
setHeader(String name,
String value) |
void |
setText(String text) |
void |
setText(String text,
String charset) |
protected void |
updateHeaders() |
void |
writeTo(OutputStream out) |
protected javax.activation.DataHandler dh
DataHandler for this Message's content.protected byte[] content
protected InputStream contentStream
SharedInputStream
then this is another such stream representing the content of this message;
if this field is non-null, then content will be null.protected InternetHeaders headers
public MimeBodyPart()
public MimeBodyPart(InputStream in) throws MessagingException
MessagingExceptionpublic MimeBodyPart(InternetHeaders headers, byte[] content) throws MessagingException
MessagingExceptionpublic int getSize()
throws MessagingException
getSize in interface PartMessagingExceptionpublic int getLineCount()
throws MessagingException
getLineCount in interface PartMessagingExceptionpublic String getContentType() throws MessagingException
getContentType in interface PartMessagingExceptionpublic boolean isMimeType(String type) throws MessagingException
isMimeType in interface Parttype - The tested type name.MessagingExceptionpublic String getDisposition() throws MessagingException
getDisposition in interface PartMessagingExceptionpublic void setDisposition(String disposition) throws MessagingException
setDisposition in interface Partdisposition - The new disposition value.MessagingExceptionpublic String getEncoding() throws MessagingException
getEncoding in interface MimePartMessagingExceptionpublic String getContentID() throws MessagingException
getContentID in interface MimePartMessagingExceptionpublic void setContentID(String cid) throws MessagingException
MessagingExceptionpublic String getContentMD5() throws MessagingException
getContentMD5 in interface MimePartMessagingExceptionpublic void setContentMD5(String md5) throws MessagingException
setContentMD5 in interface MimePartMessagingExceptionpublic String[] getContentLanguage() throws MessagingException
getContentLanguage in interface MimePartMessagingExceptionpublic void setContentLanguage(String[] languages) throws MessagingException
setContentLanguage in interface MimePartMessagingExceptionpublic String getDescription() throws MessagingException
getDescription in interface PartMessagingExceptionpublic void setDescription(String description) throws MessagingException
setDescription in interface PartMessagingExceptionpublic void setDescription(String description, String charset) throws MessagingException
MessagingExceptionpublic String getFileName() throws MessagingException
getFileName in interface PartMessagingExceptionpublic void setFileName(String name) throws MessagingException
setFileName in interface PartMessagingExceptionpublic InputStream getInputStream() throws MessagingException, IOException
getInputStream in interface PartMessagingExceptionIOExceptionprotected InputStream getContentStream() throws MessagingException
MessagingExceptionpublic InputStream getRawInputStream() throws MessagingException
MessagingExceptionpublic javax.activation.DataHandler getDataHandler()
throws MessagingException
getDataHandler in interface PartMessagingExceptionpublic Object getContent() throws MessagingException, IOException
getContent in interface PartMessagingExceptionIOExceptionpublic void setDataHandler(javax.activation.DataHandler handler)
throws MessagingException
setDataHandler in interface PartMessagingExceptionpublic void setContent(Object content, String type) throws MessagingException
setContent in interface PartMessagingExceptionpublic void setText(String text) throws MessagingException
setText in interface MimePartsetText in interface PartMessagingExceptionpublic void setText(String text, String charset) throws MessagingException
setText in interface MimePartMessagingExceptionpublic void setContent(Multipart part) throws MessagingException
setContent in interface PartMessagingExceptionpublic void writeTo(OutputStream out) throws IOException, MessagingException
writeTo in interface PartIOExceptionMessagingExceptionpublic String[] getHeader(String name) throws MessagingException
getHeader in interface PartMessagingExceptionpublic String getHeader(String name, String delimiter) throws MessagingException
getHeader in interface MimePartMessagingExceptionpublic void setHeader(String name, String value) throws MessagingException
setHeader in interface PartMessagingExceptionpublic void addHeader(String name, String value) throws MessagingException
addHeader in interface PartMessagingExceptionpublic void removeHeader(String name) throws MessagingException
removeHeader in interface PartMessagingExceptionpublic Enumeration getAllHeaders() throws MessagingException
getAllHeaders in interface PartMessagingExceptionpublic Enumeration getMatchingHeaders(String[] name) throws MessagingException
getMatchingHeaders in interface PartMessagingExceptionpublic Enumeration getNonMatchingHeaders(String[] name) throws MessagingException
getNonMatchingHeaders in interface PartMessagingExceptionpublic void addHeaderLine(String line) throws MessagingException
addHeaderLine in interface MimePartMessagingExceptionpublic Enumeration getAllHeaderLines() throws MessagingException
getAllHeaderLines in interface MimePartMessagingExceptionpublic Enumeration getMatchingHeaderLines(String[] names) throws MessagingException
getMatchingHeaderLines in interface MimePartMessagingExceptionpublic Enumeration getNonMatchingHeaderLines(String[] names) throws MessagingException
getNonMatchingHeaderLines in interface MimePartMessagingExceptionprotected void updateHeaders()
throws MessagingException
MessagingExceptionCopyright © 2013. All Rights Reserved.