public class IMAPMessage extends MimeMessage implements ReadableMime
An IMAPMessage object starts out as a light-weight object. It gets filled-in incrementally when a request is made for some item. Or when a prefetch is done using the FetchProfile.
An IMAPMessage has a messageNumber and a sequenceNumber. The messageNumber is its index into its containing folder's messageCache. The sequenceNumber is its IMAP sequence-number.
| Modifier and Type | Class and Description |
|---|---|
static class |
IMAPMessage.FetchProfileCondition
This class implements the test to be done on each
message in the folder.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFrom(Address[] addresses) |
void |
addHeader(java.lang.String name,
java.lang.String value) |
void |
addHeaderLine(java.lang.String line) |
void |
addRecipients(Message.RecipientType type,
Address[] addresses) |
java.util.Enumeration |
getAllHeaderLines()
Get all header-lines.
|
java.util.Enumeration |
getAllHeaders()
Get all headers.
|
java.lang.String |
getContentID()
Get the Content-ID.
|
java.lang.String[] |
getContentLanguage()
Get the content language.
|
java.lang.String |
getContentMD5()
Get the Content-MD5.
|
java.lang.String |
getContentType()
Get the Content-Type.
|
javax.activation.DataHandler |
getDataHandler()
Get the DataHandler object for this message.
|
java.lang.String |
getDescription()
Get the decoded Content-Description.
|
java.lang.String |
getDisposition()
Get the Content-Disposition.
|
java.lang.String |
getEncoding()
Get the Content-Transfer-Encoding.
|
java.lang.String |
getFileName()
Get the "filename" Disposition parameter.
|
Flags |
getFlags()
Get the Flags for this message.
|
Address[] |
getFrom()
Get the "From" attribute.
|
java.lang.String[] |
getHeader(java.lang.String name)
Get the named header.
|
java.lang.String |
getHeader(java.lang.String name,
java.lang.String delimiter)
Get the named header.
|
java.lang.String |
getInReplyTo()
Get the In-Reply-To header.
|
java.lang.Object |
getItem(FetchItem fitem)
Return the data associated with the FetchItem.
|
int |
getLineCount()
Get the total number of lines.
|
java.util.Enumeration |
getMatchingHeaderLines(java.lang.String[] names)
Get all matching header-lines.
|
java.util.Enumeration |
getMatchingHeaders(java.lang.String[] names)
Get matching headers.
|
java.lang.String |
getMessageID()
Get the Message-ID.
|
java.io.InputStream |
getMimeStream()
Return the MIME format stream corresponding to this message.
|
java.util.Enumeration |
getNonMatchingHeaderLines(java.lang.String[] names)
Get all non-matching headerlines.
|
java.util.Enumeration |
getNonMatchingHeaders(java.lang.String[] names)
Get non-matching headers.
|
boolean |
getPeek()
Get whether or not to use the PEEK variant of FETCH when
fetching message content.
|
java.util.Date |
getReceivedDate()
Get the recieved date (INTERNALDATE)
|
Address[] |
getRecipients(Message.RecipientType type)
Get the desired Recipient type.
|
Address[] |
getReplyTo()
Get the ReplyTo addresses.
|
Address |
getSender()
Get the "Sender" attribute.
|
java.util.Date |
getSentDate()
Get the SentDate.
|
int |
getSize()
Get the message size.
|
java.lang.String |
getSubject()
Get the decoded subject.
|
void |
invalidateHeaders()
Invalidate cached header and envelope information for this
message.
|
boolean |
isSet(Flags.Flag flag)
Test if the given Flags are set in this message.
|
void |
removeHeader(java.lang.String name) |
void |
setContentID(java.lang.String cid) |
void |
setContentLanguage(java.lang.String[] languages) |
void |
setContentMD5(java.lang.String md5) |
void |
setDataHandler(javax.activation.DataHandler content) |
void |
setDescription(java.lang.String description,
java.lang.String charset) |
void |
setDisposition(java.lang.String disposition) |
void |
setFileName(java.lang.String filename) |
void |
setFlags(Flags flag,
boolean set)
Set/Unset the given flags in this message.
|
void |
setFrom(Address address) |
void |
setHeader(java.lang.String name,
java.lang.String value) |
void |
setPeek(boolean peek)
Set whether or not to use the PEEK variant of FETCH when
fetching message content.
|
void |
setRecipients(Message.RecipientType type,
Address[] addresses) |
void |
setReplyTo(Address[] addresses) |
void |
setSender(Address address) |
void |
setSentDate(java.util.Date d) |
void |
setSubject(java.lang.String subject,
java.lang.String charset) |
void |
writeTo(java.io.OutputStream os)
Write out the bytes into the given OutputStream.
|
public Address[] getFrom()
throws MessagingException
MessagingExceptionpublic void setFrom(Address address)
throws MessagingException
MessagingExceptionpublic void addFrom(Address[] addresses)
throws MessagingException
MessagingExceptionpublic Address getSender()
throws MessagingException
MessagingExceptionpublic void setSender(Address address)
throws MessagingException
MessagingExceptionpublic Address[] getRecipients(Message.RecipientType type)
throws MessagingException
MessagingExceptionpublic void setRecipients(Message.RecipientType type,
Address[] addresses)
throws MessagingException
MessagingExceptionpublic void addRecipients(Message.RecipientType type,
Address[] addresses)
throws MessagingException
MessagingExceptionpublic Address[] getReplyTo()
throws MessagingException
MessagingExceptionpublic void setReplyTo(Address[] addresses)
throws MessagingException
MessagingExceptionpublic java.lang.String getSubject()
throws MessagingException
MessagingExceptionpublic void setSubject(java.lang.String subject,
java.lang.String charset)
throws MessagingException
MessagingExceptionpublic java.util.Date getSentDate()
throws MessagingException
MessagingExceptionpublic void setSentDate(java.util.Date d)
throws MessagingException
MessagingExceptionpublic java.util.Date getReceivedDate()
throws MessagingException
MessagingExceptionpublic int getSize()
throws MessagingException
Note that this returns RFC822.SIZE. That is, it's the size of the whole message, header and body included.
MessagingExceptionpublic int getLineCount()
throws MessagingException
Returns the "body_fld_lines" field from the BODYSTRUCTURE. Note that this field is available only for text/plain and message/rfc822 types
MessagingExceptionpublic java.lang.String[] getContentLanguage()
throws MessagingException
MessagingExceptionpublic void setContentLanguage(java.lang.String[] languages)
throws MessagingException
MessagingExceptionpublic java.lang.String getInReplyTo()
throws MessagingException
MessagingExceptionpublic java.lang.String getContentType()
throws MessagingException
MessagingExceptionpublic java.lang.String getDisposition()
throws MessagingException
MessagingExceptionpublic void setDisposition(java.lang.String disposition)
throws MessagingException
MessagingExceptionpublic java.lang.String getEncoding()
throws MessagingException
MessagingExceptionpublic java.lang.String getContentID()
throws MessagingException
MessagingExceptionpublic void setContentID(java.lang.String cid)
throws MessagingException
MessagingExceptionpublic java.lang.String getContentMD5()
throws MessagingException
MessagingExceptionpublic void setContentMD5(java.lang.String md5)
throws MessagingException
MessagingExceptionpublic java.lang.String getDescription()
throws MessagingException
MessagingExceptionpublic void setDescription(java.lang.String description,
java.lang.String charset)
throws MessagingException
MessagingExceptionpublic java.lang.String getMessageID()
throws MessagingException
MessagingExceptionpublic java.lang.String getFileName()
throws MessagingException
MessagingExceptionpublic void setFileName(java.lang.String filename)
throws MessagingException
MessagingExceptionpublic javax.activation.DataHandler getDataHandler()
throws MessagingException
MessagingExceptionpublic void setDataHandler(javax.activation.DataHandler content)
throws MessagingException
MessagingExceptionpublic java.io.InputStream getMimeStream()
throws MessagingException
getMimeStream in interface ReadableMimeMessagingExceptionpublic void writeTo(java.io.OutputStream os)
throws java.io.IOException,
MessagingException
java.io.IOExceptionMessagingExceptionpublic java.lang.String[] getHeader(java.lang.String name)
throws MessagingException
MessagingExceptionpublic java.lang.String getHeader(java.lang.String name,
java.lang.String delimiter)
throws MessagingException
MessagingExceptionpublic void setHeader(java.lang.String name,
java.lang.String value)
throws MessagingException
MessagingExceptionpublic void addHeader(java.lang.String name,
java.lang.String value)
throws MessagingException
MessagingExceptionpublic void removeHeader(java.lang.String name)
throws MessagingException
MessagingExceptionpublic java.util.Enumeration getAllHeaders()
throws MessagingException
MessagingExceptionpublic java.util.Enumeration getMatchingHeaders(java.lang.String[] names)
throws MessagingException
MessagingExceptionpublic java.util.Enumeration getNonMatchingHeaders(java.lang.String[] names)
throws MessagingException
MessagingExceptionpublic void addHeaderLine(java.lang.String line)
throws MessagingException
MessagingExceptionpublic java.util.Enumeration getAllHeaderLines()
throws MessagingException
MessagingExceptionpublic java.util.Enumeration getMatchingHeaderLines(java.lang.String[] names)
throws MessagingException
MessagingExceptionpublic java.util.Enumeration getNonMatchingHeaderLines(java.lang.String[] names)
throws MessagingException
MessagingExceptionpublic Flags getFlags()
throws MessagingException
MessagingExceptionpublic boolean isSet(Flags.Flag flag)
throws MessagingException
MessagingExceptionpublic void setFlags(Flags flag,
boolean set)
throws MessagingException
MessagingExceptionpublic void setPeek(boolean peek)
public boolean getPeek()
public void invalidateHeaders()
public java.lang.Object getItem(FetchItem fitem) throws MessagingException
MessagingException"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"