|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectMimeMessage
com.sun.mail.imap.IMAPMessage
public class IMAPMessage
This class implements an IMAPMessage object.
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.
| Field Summary | |
|---|---|
protected BODYSTRUCTURE |
bs
|
protected ENVELOPE |
envelope
|
protected String |
sectionId
|
| Constructor Summary | |
|---|---|
protected |
IMAPMessage(IMAPFolder folder,
int msgnum)
Constructor. |
protected |
IMAPMessage(Session session)
Constructor, for use by IMAPNestedMessage. |
| Method Summary | |
|---|---|
void |
addFrom(Address[] addresses)
|
void |
addHeader(String name,
String value)
|
void |
addHeaderLine(String line)
|
void |
addRecipients(Message.RecipientType type,
Address[] addresses)
|
protected void |
checkExpunged()
|
protected void |
forceCheckExpunged()
Do a NOOP to force any untagged EXPUNGE responses and then check if this message is expunged. |
Enumeration |
getAllHeaderLines()
Get all header-lines. |
Enumeration |
getAllHeaders()
Get all headers. |
String |
getContentID()
Get the Content-ID. |
String[] |
getContentLanguage()
Get the content language. |
String |
getContentMD5()
Get the Content-MD5. |
protected InputStream |
getContentStream()
Get all the bytes for this message. |
String |
getContentType()
Get the Content-Type. |
DataHandler |
getDataHandler()
Get the DataHandler object for this message. |
String |
getDescription()
Get the decoded Content-Description. |
String |
getDisposition()
Get the Content-Disposition. |
String |
getEncoding()
Get the Content-Transfer-Encoding. |
protected int |
getFetchBlockSize()
|
String |
getFileName()
Get the "filename" Disposition parameter. |
Flags |
getFlags()
Get the Flags for this message. |
Address[] |
getFrom()
Get the "From" attribute. |
String[] |
getHeader(String name)
Get the named header. |
String |
getHeader(String name,
String delimiter)
Get the named header. |
String |
getInReplyTo()
Get the In-Reply-To header. |
int |
getLineCount()
Get the total number of lines. |
Enumeration |
getMatchingHeaderLines(String[] names)
Get all matching header-lines. |
Enumeration |
getMatchingHeaders(String[] names)
Get matching headers. |
protected Object |
getMessageCacheLock()
Get the messageCacheLock, associated with this Message's Folder. |
String |
getMessageID()
Get the Message-ID. |
InputStream |
getMimeStream()
Return the MIME format stream corresponding to this message. |
Enumeration |
getNonMatchingHeaderLines(String[] names)
Get all non-matching headerlines. |
Enumeration |
getNonMatchingHeaders(String[] names)
Get non-matching headers. |
boolean |
getPeek()
Get whether or not to use the PEEK variant of FETCH when fetching message content. |
protected IMAPProtocol |
getProtocol()
Get this message's folder's protocol connection. |
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. |
Date |
getSentDate()
Get the SentDate. |
protected int |
getSequenceNumber()
Get this message's IMAP sequence number. |
int |
getSize()
Get the message size. |
String |
getSubject()
Get the decoded subject. |
protected long |
getUID()
|
void |
invalidateHeaders()
Invalidate cached header and envelope information for this message. |
protected boolean |
isREV1()
|
boolean |
isSet(Flags.Flag flag)
Test if the given Flags are set in this message. |
void |
removeHeader(String name)
|
void |
setContentID(String cid)
|
void |
setContentLanguage(String[] languages)
|
void |
setContentMD5(String md5)
|
void |
setDataHandler(DataHandler content)
|
void |
setDescription(String description,
String charset)
|
void |
setDisposition(String disposition)
|
protected void |
setExpunged(boolean set)
|
void |
setFileName(String filename)
|
void |
setFlags(Flags flag,
boolean set)
Set/Unset the given flags in this message. |
void |
setFrom(Address address)
|
void |
setHeader(String name,
String value)
|
protected void |
setMessageNumber(int msgnum)
Wrapper around the protected method Message.setMessageNumber() to make that method accessible to IMAPFolder. |
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(Date d)
|
void |
setSubject(String subject,
String charset)
|
protected void |
setUID(long uid)
|
void |
writeTo(OutputStream os)
Write out the bytes into the given OutputStream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected BODYSTRUCTURE bs
protected ENVELOPE envelope
protected String sectionId
| Constructor Detail |
|---|
protected IMAPMessage(IMAPFolder folder,
int msgnum)
protected IMAPMessage(Session session)
| Method Detail |
|---|
protected IMAPProtocol getProtocol()
throws ProtocolException,
FolderClosedException
ProtocolException
FolderClosedException
protected boolean isREV1()
throws FolderClosedException
FolderClosedExceptionprotected Object getMessageCacheLock()
protected int getSequenceNumber()
protected void setMessageNumber(int msgnum)
protected long getUID()
protected void setUID(long uid)
protected void setExpunged(boolean set)
protected void checkExpunged()
throws MessageRemovedException
MessageRemovedException
protected void forceCheckExpunged()
throws MessageRemovedException,
FolderClosedException
MessageRemovedException
FolderClosedExceptionprotected int getFetchBlockSize()
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 String getSubject()
throws MessagingException
MessagingException
public void setSubject(String subject,
String charset)
throws MessagingException
MessagingException
public Date getSentDate()
throws MessagingException
MessagingException
public void setSentDate(Date d)
throws MessagingException
MessagingException
public 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 String[] getContentLanguage()
throws MessagingException
MessagingException
public void setContentLanguage(String[] languages)
throws MessagingException
MessagingException
public String getInReplyTo()
throws MessagingException
MessagingException
public String getContentType()
throws MessagingException
MessagingException
public String getDisposition()
throws MessagingException
MessagingException
public void setDisposition(String disposition)
throws MessagingException
MessagingException
public String getEncoding()
throws MessagingException
MessagingException
public String getContentID()
throws MessagingException
MessagingException
public void setContentID(String cid)
throws MessagingException
MessagingException
public String getContentMD5()
throws MessagingException
MessagingException
public void setContentMD5(String md5)
throws MessagingException
MessagingException
public String getDescription()
throws MessagingException
MessagingException
public void setDescription(String description,
String charset)
throws MessagingException
MessagingException
public String getMessageID()
throws MessagingException
MessagingException
public String getFileName()
throws MessagingException
MessagingException
public void setFileName(String filename)
throws MessagingException
MessagingException
protected InputStream getContentStream()
throws MessagingException
MessagingExceptionMimeMessage
public DataHandler getDataHandler()
throws MessagingException
MessagingException
public void setDataHandler(DataHandler content)
throws MessagingException
MessagingException
public InputStream getMimeStream()
throws MessagingException
MessagingException
public void writeTo(OutputStream os)
throws IOException,
MessagingException
IOException
MessagingException
public String[] getHeader(String name)
throws MessagingException
MessagingException
public String getHeader(String name,
String delimiter)
throws MessagingException
MessagingException
public void setHeader(String name,
String value)
throws MessagingException
MessagingException
public void addHeader(String name,
String value)
throws MessagingException
MessagingException
public void removeHeader(String name)
throws MessagingException
MessagingException
public Enumeration getAllHeaders()
throws MessagingException
MessagingException
public Enumeration getMatchingHeaders(String[] names)
throws MessagingException
MessagingException
public Enumeration getNonMatchingHeaders(String[] names)
throws MessagingException
MessagingException
public void addHeaderLine(String line)
throws MessagingException
MessagingException
public Enumeration getAllHeaderLines()
throws MessagingException
MessagingException
public Enumeration getMatchingHeaderLines(String[] names)
throws MessagingException
MessagingException
public Enumeration getNonMatchingHeaderLines(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
MessagingExceptionpublic void setPeek(boolean peek)
public boolean getPeek()
public void invalidateHeaders()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||