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
MessagingException
public void setFrom(Address address) throws MessagingException
MessagingException
public void addFrom(Address[] addresses) throws MessagingException
MessagingException
public Address getSender() throws MessagingException
MessagingException
public void setSender(Address address) throws MessagingException
MessagingException
public Address[] getRecipients(Message.RecipientType type) throws MessagingException
MessagingException
public void setRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException
MessagingException
public void addRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException
MessagingException
public Address[] getReplyTo() throws MessagingException
MessagingException
public void setReplyTo(Address[] addresses) throws MessagingException
MessagingException
public java.lang.String getSubject() throws MessagingException
MessagingException
public void setSubject(java.lang.String subject, java.lang.String charset) throws MessagingException
MessagingException
public java.util.Date getSentDate() throws MessagingException
MessagingException
public void setSentDate(java.util.Date d) throws MessagingException
MessagingException
public java.util.Date getReceivedDate() throws MessagingException
MessagingException
public int getSize() throws MessagingException
Note that this returns RFC822.SIZE. That is, it's the size of the whole message, header and body included.
MessagingException
public 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
MessagingException
public java.lang.String[] getContentLanguage() throws MessagingException
MessagingException
public void setContentLanguage(java.lang.String[] languages) throws MessagingException
MessagingException
public java.lang.String getInReplyTo() throws MessagingException
MessagingException
public java.lang.String getContentType() throws MessagingException
MessagingException
public java.lang.String getDisposition() throws MessagingException
MessagingException
public void setDisposition(java.lang.String disposition) throws MessagingException
MessagingException
public java.lang.String getEncoding() throws MessagingException
MessagingException
public java.lang.String getContentID() throws MessagingException
MessagingException
public void setContentID(java.lang.String cid) throws MessagingException
MessagingException
public java.lang.String getContentMD5() throws MessagingException
MessagingException
public void setContentMD5(java.lang.String md5) throws MessagingException
MessagingException
public java.lang.String getDescription() throws MessagingException
MessagingException
public void setDescription(java.lang.String description, java.lang.String charset) throws MessagingException
MessagingException
public java.lang.String getMessageID() throws MessagingException
MessagingException
public java.lang.String getFileName() throws MessagingException
MessagingException
public void setFileName(java.lang.String filename) throws MessagingException
MessagingException
public javax.activation.DataHandler getDataHandler() throws MessagingException
MessagingException
public void setDataHandler(javax.activation.DataHandler content) throws MessagingException
MessagingException
public java.io.InputStream getMimeStream() throws MessagingException
getMimeStream
in interface ReadableMime
MessagingException
public void writeTo(java.io.OutputStream os) throws java.io.IOException, MessagingException
java.io.IOException
MessagingException
public java.lang.String[] getHeader(java.lang.String name) throws MessagingException
MessagingException
public java.lang.String getHeader(java.lang.String name, java.lang.String delimiter) throws MessagingException
MessagingException
public void setHeader(java.lang.String name, java.lang.String value) throws MessagingException
MessagingException
public void addHeader(java.lang.String name, java.lang.String value) throws MessagingException
MessagingException
public void removeHeader(java.lang.String name) throws MessagingException
MessagingException
public java.util.Enumeration getAllHeaders() throws MessagingException
MessagingException
public java.util.Enumeration getMatchingHeaders(java.lang.String[] names) throws MessagingException
MessagingException
public java.util.Enumeration getNonMatchingHeaders(java.lang.String[] names) throws MessagingException
MessagingException
public void addHeaderLine(java.lang.String line) throws MessagingException
MessagingException
public java.util.Enumeration getAllHeaderLines() throws MessagingException
MessagingException
public java.util.Enumeration getMatchingHeaderLines(java.lang.String[] names) throws MessagingException
MessagingException
public java.util.Enumeration getNonMatchingHeaderLines(java.lang.String[] names) throws MessagingException
MessagingException
public Flags getFlags() throws MessagingException
MessagingException
public boolean isSet(Flags.Flag flag) throws MessagingException
MessagingException
public void setFlags(Flags flag, boolean set) throws MessagingException
MessagingException
public 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"