javax.mail.internet
public class MimeMessage extends Message implements MimePart
Nested Class Summary | |
---|---|
static class | MimeMessage.RecipientType
Extends RecipientType to support addition recipient types. |
Field Summary | |
---|---|
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 DataHandler | dh
The DataHandler for this Message's content. |
protected Flags | flags
This message's flags. |
protected InternetHeaders | headers
This message's headers. |
protected boolean | modified
Flag indicating that the message has been modified; set to true when
an empty message is created or when saveChanges is called. |
protected boolean | saved
Flag indicating that the message has been saved. |
Constructor Summary | |
---|---|
MimeMessage(Session session)
Create a new MimeMessage.
| |
MimeMessage(Session session, InputStream in)
Create a MimeMessage by reading an parsing the data from the supplied stream.
| |
MimeMessage(MimeMessage message)
Copy a MimeMessage.
| |
protected | MimeMessage(Folder folder, int number)
Create an new MimeMessage in the supplied Folder and message number.
|
protected | MimeMessage(Folder folder, InputStream in, int number)
Create a MimeMessage by reading an parsing the data from the supplied stream.
|
protected | MimeMessage(Folder folder, InternetHeaders headers, byte[] content, int number)
Create a MimeMessage with the supplied headers and content.
|
Method Summary | |
---|---|
void | addFrom(Address[] addresses) |
void | addHeader(String name, String value) |
void | addHeaderLine(String line) |
void | addRecipients(Message.RecipientType type, Address[] address) |
void | addRecipients(Message.RecipientType type, String address) |
protected InternetHeaders | createInternetHeaders(InputStream in) |
Enumeration | getAllHeaderLines() |
Enumeration | getAllHeaders() |
Address[] | getAllRecipients() |
Object | getContent() |
String | getContentID() |
String[] | getContentLanguage() |
String | getContentMD5() |
protected InputStream | getContentStream() |
String | getContentType() |
DataHandler | getDataHandler() |
String | getDescription() |
String | getDisposition() |
String | getEncoding() |
String | getFileName() |
Flags | getFlags() |
Address[] | getFrom() |
String[] | getHeader(String name) |
String | getHeader(String name, String delimiter) |
InputStream | getInputStream() |
int | getLineCount() |
Enumeration | getMatchingHeaderLines(String[] names) |
Enumeration | getMatchingHeaders(String[] names) |
String | getMessageID() |
Enumeration | getNonMatchingHeaderLines(String[] names) |
Enumeration | getNonMatchingHeaders(String[] names) |
InputStream | getRawInputStream() |
Date | getReceivedDate() |
Address[] | getRecipients(Message.RecipientType type) |
Address[] | getReplyTo() |
Address | getSender()
Return the "Sender" header as an address.
|
Date | getSentDate() |
int | getSize() |
String | getSubject() |
boolean | isMimeType(String type) |
boolean | isSet(Flags.Flag flag) |
protected void | parse(InputStream in) |
void | removeHeader(String name) |
Message | reply(boolean replyToAll) |
void | saveChanges() |
void | setContent(Object content, String type) |
void | setContent(Multipart part) |
void | setContentID(String cid) |
void | setContentLanguage(String[] languages) |
void | setContentMD5(String md5) |
void | setDataHandler(DataHandler handler) |
void | setDescription(String description) |
void | setDescription(String description, String charset) |
void | setDisposition(String disposition) |
void | setFileName(String name) |
void | setFlags(Flags flags, boolean set) |
void | setFrom(Address address) |
void | setFrom()
Set the "From" header using the value returned by getLocalAddress.
|
void | setHeader(String name, String value) |
void | setRecipients(Message.RecipientType type, Address[] addresses) |
void | setRecipients(Message.RecipientType type, String address) |
void | setReplyTo(Address[] address) |
void | setSender(Address address)
Set the "Sender" header.
|
void | setSentDate(Date sent) |
void | setSubject(String subject) |
void | setSubject(String subject, String charset) |
void | setText(String text) |
void | setText(String text, String charset) |
protected void | updateHeaders() |
void | writeTo(OutputStream out) |
void | writeTo(OutputStream out, String[] ignoreHeaders) |
Parameters: session the session for this message
Parameters: session the session for this message in the stream to load from
Throws: MessagingException if there is a problem reading or parsing the stream
Parameters: message the message to copy
Throws: MessagingException is there was a problem copying the message
Parameters: folder the Folder that contains the new message number the message number of the new message
Parameters: folder the folder for this message in the stream to load from number the message number of the new message
Throws: MessagingException if there is a problem reading or parsing the stream
Parameters: folder the folder for this message headers the headers for the new message content the content of the new message number the message number of the new message
Throws: MessagingException if there is a problem reading or parsing the stream
Returns: the "Sender" header as an address, or null if not present
Throws: MessagingException if there was a problem parsing the header
Parameters: in the stream to read
Throws: MessagingException if there was a problem parsing the stream
Throws: MessagingException if there was a problem setting the header
Parameters: address the new Sender address
Throws: MessagingException if there was a problem setting the header