Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.mail.Message
javax.mail.internet.MimeMessage
Nested Class Summary | |
static class |
|
Nested classes/interfaces inherited from class javax.mail.Message | |
Message.RecipientType |
Field Summary | |
protected byte[] |
|
protected InputStream |
|
protected DataHandler |
|
protected Flags |
|
protected InternetHeaders |
|
protected boolean |
|
protected boolean |
|
Fields inherited from interface javax.mail.Part | |
ATTACHMENT , INLINE |
Constructor Summary | |
| |
| |
| |
| |
| |
|
Method Summary | |
void | |
void |
|
void |
|
void |
|
void |
|
protected InternetHeaders |
|
Enumeration | |
Enumeration | |
Address[] | |
Object | |
String | |
String[] | |
String | |
protected InputStream | |
String | |
DataHandler | |
String | |
String | |
String | |
String | |
Flags |
|
Address[] |
|
String[] |
|
String |
|
InputStream | |
int | |
Enumeration |
|
Enumeration |
|
String | |
Enumeration |
|
Enumeration |
|
InputStream | |
Date | |
Address[] | |
Address[] | |
Address |
|
Date | |
int |
|
String | |
boolean |
|
boolean |
|
protected void | |
void |
|
Message |
|
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
protected void | |
void |
|
void |
|
Methods inherited from class javax.mail.Message | |
addFrom , addRecipient , addRecipients , getAllRecipients , getFlags , getFolder , getFrom , getMessageNumber , getReceivedDate , getRecipients , getReplyTo , getSentDate , getSubject , isExpunged , isSet , match , reply , saveChanges , setExpunged , setFlag , setFlags , setFrom , setFrom , setMessageNumber , setRecipient , setRecipients , setReplyTo , setSentDate , setSubject |
protected byte[] content
This message's content (unless sourced from a SharedInputStream).
protected InputStream contentStream
If the data for this message was supplied by aSharedInputStream
then this is another such stream representing the content of this message; if this field is non-null, thencontent
will be null.
protected DataHandler dh
TheDataHandler
for this Message's content.
protected boolean modified
Flag indicating that the message has been modified; set to true when an empty message is created or whensaveChanges()
is called.
protected boolean saved
Flag indicating that the message has been saved.
protected MimeMessage(Folder folder, InputStream in, int number) throws MessagingException
Create a MimeMessage by reading an parsing the data from the supplied stream.
- Parameters:
folder
- the folder for this messagein
- the stream to load fromnumber
- the message number of the new message
- Throws:
MessagingException
- if there is a problem reading or parsing the stream
protected MimeMessage(Folder folder, int number)
Create an new MimeMessage in the suppliedFolder
and message number.
- Parameters:
folder
- the Folder that contains the new messagenumber
- the message number of the new message
protected MimeMessage(Folder folder, InternetHeaders headers, byte[] content, int number) throws MessagingException
Create a MimeMessage with the supplied headers and content.
- Parameters:
folder
- the folder for this messageheaders
- the headers for the new messagecontent
- the content of the new messagenumber
- the message number of the new message
- Throws:
MessagingException
- if there is a problem reading or parsing the stream
public MimeMessage(Session session)
Create a new MimeMessage. An empty message is created, with emptyheaders
and emptyflags
. Themodified
flag is set.
- Parameters:
session
- the session for this message
public MimeMessage(Session session, InputStream in) throws MessagingException
Create a MimeMessage by reading an parsing the data from the supplied stream.
- Parameters:
session
- the session for this messagein
- the stream to load from
- Throws:
MessagingException
- if there is a problem reading or parsing the stream
public MimeMessage(MimeMessage message) throws MessagingException
Copy a MimeMessage.
- Parameters:
message
- the message to copy
- Throws:
MessagingException
- is there was a problem copying the message
public void addHeaderLine(String line) throws MessagingException
- Specified by:
- addHeaderLine in interface MimePart
public void addRecipients(Message.RecipientType type, String address) throws MessagingException
public void addRecipients(Message.RecipientType type, Address[] address) throws MessagingException
- Overrides:
- addRecipients in interface Message
protected InternetHeaders createInternetHeaders(InputStream in) throws MessagingException
public Enumeration getAllHeaderLines() throws MessagingException
- Specified by:
- getAllHeaderLines in interface MimePart
public Enumeration getAllHeaders() throws MessagingException
- Specified by:
- getAllHeaders in interface Part
public Address[] getAllRecipients() throws MessagingException
- Overrides:
- getAllRecipients in interface Message
public Object getContent() throws MessagingException, IOException
- Specified by:
- getContent in interface Part
public String getContentID() throws MessagingException
- Specified by:
- getContentID in interface MimePart
public String[] getContentLanguage() throws MessagingException
- Specified by:
- getContentLanguage in interface MimePart
public String getContentMD5() throws MessagingException
- Specified by:
- getContentMD5 in interface MimePart
public String getContentType() throws MessagingException
- Specified by:
- getContentType in interface Part
public DataHandler getDataHandler() throws MessagingException
- Specified by:
- getDataHandler in interface Part
public String getDescription() throws MessagingException
- Specified by:
- getDescription in interface Part
public String getDisposition() throws MessagingException
- Specified by:
- getDisposition in interface Part
public String getEncoding() throws MessagingException
- Specified by:
- getEncoding in interface MimePart
public String getFileName() throws MessagingException
- Specified by:
- getFileName in interface Part
public InputStream getInputStream() throws MessagingException, IOException
- Specified by:
- getInputStream in interface Part
public int getLineCount() throws MessagingException
- Specified by:
- getLineCount in interface Part
public Enumeration getMatchingHeaderLines(String[] names) throws MessagingException
- Specified by:
- getMatchingHeaderLines in interface MimePart
public Enumeration getMatchingHeaders(String[] names) throws MessagingException
- Specified by:
- getMatchingHeaders in interface Part
public Enumeration getNonMatchingHeaderLines(String[] names) throws MessagingException
- Specified by:
- getNonMatchingHeaderLines in interface MimePart
public Enumeration getNonMatchingHeaders(String[] names) throws MessagingException
- Specified by:
- getNonMatchingHeaders in interface Part
public Date getReceivedDate() throws MessagingException
- Overrides:
- getReceivedDate in interface Message
public Address[] getRecipients(Message.RecipientType type) throws MessagingException
- Overrides:
- getRecipients in interface Message
public Address[] getReplyTo() throws MessagingException
- Overrides:
- getReplyTo in interface Message
public Address getSender() throws MessagingException
Return the "Sender" header as an address.
- Returns:
- the "Sender" header as an address, or null if not present
- Throws:
MessagingException
- if there was a problem parsing the header
public Date getSentDate() throws MessagingException
- Overrides:
- getSentDate in interface Message
public String getSubject() throws MessagingException
- Overrides:
- getSubject in interface Message
public boolean isMimeType(String type) throws MessagingException
- Specified by:
- isMimeType in interface Part
protected void parse(InputStream in) throws MessagingException
- Parameters:
in
- the stream to read
- Throws:
MessagingException
- if there was a problem parsing the stream
public void removeHeader(String name) throws MessagingException
- Specified by:
- removeHeader in interface Part
public void saveChanges() throws MessagingException
- Overrides:
- saveChanges in interface Message
public void setContent(Object content, String type) throws MessagingException
- Specified by:
- setContent in interface Part
public void setContent(Multipart part) throws MessagingException
- Specified by:
- setContent in interface Part
public void setContentLanguage(String[] languages) throws MessagingException
- Specified by:
- setContentLanguage in interface MimePart
public void setContentMD5(String md5) throws MessagingException
- Specified by:
- setContentMD5 in interface MimePart
public void setDataHandler(DataHandler handler) throws MessagingException
- Specified by:
- setDataHandler in interface Part
public void setDescription(String description) throws MessagingException
- Specified by:
- setDescription in interface Part
public void setDescription(String description, String charset) throws MessagingException
public void setDisposition(String disposition) throws MessagingException
- Specified by:
- setDisposition in interface Part
public void setFileName(String name) throws MessagingException
- Specified by:
- setFileName in interface Part
public void setFrom() throws MessagingException
Set the "From" header using the value returned byInternetAddress.getLocalAddress(Session)
.
- Throws:
MessagingException
- if there was a problem setting the header
public void setRecipients(Message.RecipientType type, String address) throws MessagingException
public void setRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException
- Overrides:
- setRecipients in interface Message
public void setReplyTo(Address[] address) throws MessagingException
- Overrides:
- setReplyTo in interface Message
public void setSender(Address address) throws MessagingException
Set the "Sender" header.
- Parameters:
address
- the new Sender address
- Throws:
MessagingException
- if there was a problem setting the header
public void setSentDate(Date sent) throws MessagingException
- Overrides:
- setSentDate in interface Message
public void setSubject(String subject) throws MessagingException
- Overrides:
- setSubject in interface Message
public void writeTo(OutputStream out, String[] ignoreHeaders) throws MessagingException, IOException