| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public class IMAPMessage extends MimeMessage
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.mail.internet.MimeMessage |
---|
MimeMessage.RecipientType |
Nested classes/interfaces inherited from class javax.mail.Message |
---|
Message.RecipientType |
Field Summary | |
---|---|
protected BODYSTRUCTURE |
bs
|
protected ENVELOPE |
envelope
|
protected String |
sectionId
|
Fields inherited from class javax.mail.internet.MimeMessage |
---|
content, contentStream, dh, flags, headers, modified, saved |
Fields inherited from class javax.mail.Message |
---|
expunged, folder, msgnum, session |
Constructor Summary | |
---|---|
protected |
IMAPMessage(IMAPFolder folder, int msgnum, int seqnum) Constructor. |
protected |
IMAPMessage(Session session) Constructor, for use by IMAPNestedMessage. |
Method Summary | |
---|---|
void |
Add the specified addresses to the existing "From" field. |
void |
Add this value to the existing values for this header_name. |
void |
addHeaderLine(String line) Add a raw RFC 822 header-line. |
void |
addRecipients(Message.RecipientType type, Address[] addresses) Add the given addresses to the specified recipient type. |
protected void |
|
protected void |
Do a NOOP to force any untagged EXPUNGE responses and then check if this message is expunged. |
Enumeration |
Get all header-lines. |
Enumeration |
Get all headers. |
String |
Get the Content-ID. |
String[] |
Get the content language. |
String |
Get the Content-MD5. |
protected InputStream |
Get all the bytes for this message. |
String |
Get the Content-Type. |
DataHandler |
Get the DataHandler object for this message. |
String |
Get the decoded Content-Description. |
String |
Get the Content-Disposition. |
String |
Get the Content-Transfer-Encoding. |
protected int |
|
String |
Get the "filename" Disposition parameter. |
Flags |
getFlags() Get the Flags for this message. |
Address[] |
getFrom() Get the "From" attribute. |
String[] |
Get the named header. |
String |
Get the named header. |
String |
Get the In-Reply-To header. |
int |
Get the total number of lines. |
Enumeration |
getMatchingHeaderLines(String[] names) Get all matching header-lines. |
Enumeration |
getMatchingHeaders(String[] names) Get matching headers. |
protected Object |
Get the messageCacheLock, associated with this Message's Folder. |
String |
Get the Message-ID. |
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 |
Get this message's folder's protocol connection. |
Date |
Get the recieved date (INTERNALDATE) |
Address[] |
Get the desired Recipient type. |
Address[] |
Get the ReplyTo addresses. |
Address |
Get the "Sender" attribute. |
Date |
Get the SentDate. |
protected int |
Get this message's IMAP sequence number. |
int |
getSize() Get the message size. |
String |
Get the decoded subject. |
protected long |
getUID() |
void |
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) Remove all headers with this name. |
void |
setContentID(String cid) Set the "Content-ID" header field of this Message. |
void |
setContentLanguage(String[] languages) Set the "Content-Language" header of this MimePart. |
void |
setContentMD5(String md5) Set the "Content-MD5" header field of this Message. |
void |
setDataHandler(DataHandler content) This method provides the mechanism to set this part's content. |
void |
setDescription(String description, String charset) Set the "Content-Description" header field for this Message. |
void |
setDisposition(String disposition) Set the "Content-Disposition" header field of this Message. |
protected void |
setExpunged(boolean set) Sets the expunged flag for this Message. |
void |
setFileName(String filename) Set the filename associated with this part, if possible. |
void |
Set/Unset the given flags in this message. |
void |
Set the RFC 822 "From" header field. |
void |
Set the value for this header_name. |
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) Set the specified recipient type to the given addresses. |
void |
setReplyTo(Address[] addresses) Set the RFC 822 "Reply-To" header field. |
void |
Set the RFC 822 "Sender" header field. |
void |
setSentDate(Date d) Set the RFC 822 "Date" header field. |
protected void |
setSequenceNumber(int seqnum) Set this message's IMAP sequence number. |
void |
setSubject(String subject, String charset) Set the "Subject" header field. |
protected void |
setUID(long uid) |
void |
writeTo(OutputStream os) Write out the bytes into the given outputstream. |
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, send, setExpunged, setFlag, setFlags, setFrom, setFrom, setMessageNumber, setRecipient, setRecipients, setReplyTo, setSentDate, setSubject |
Field Detail |
---|
protected BODYSTRUCTURE bs
protected ENVELOPE envelope
protected String sectionId
Constructor Detail |
---|
protected IMAPMessage(IMAPFolder folder, int msgnum, int seqnum)
folder
msgnum
seqnum
protected IMAPMessage(Session session)
session
Method Detail |
---|
public void addFrom(Address[] addresses) throws MessagingException
addFrom
in class MimeMessage
addresses
MessagingException
public void addHeader(String name, String value) throws MessagingException
addHeader
in class MimeMessage
name
value
MessagingException
public void addHeaderLine(String line) throws MessagingException
addHeaderLine
in class MimeMessage
line
MessagingException
public void addRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException
addRecipients
in class MimeMessage
type
addresses
MessagingException
protected void checkExpunged() throws MessageRemovedException
MessageRemovedException
protected void forceCheckExpunged() throws MessageRemovedException, FolderClosedException
MessageRemovedException
FolderClosedException
public Enumeration getAllHeaderLines() throws MessagingException
getAllHeaderLines
in class MimeMessage
MessagingException
public Enumeration getAllHeaders() throws MessagingException
getAllHeaders
in class MimeMessage
MessagingException
public String getContentID() throws MessagingException
getContentID
in class MimeMessage
MessagingException
public String[] getContentLanguage() throws MessagingException
getContentLanguage
in class MimeMessage
MessagingException
public String getContentMD5() throws MessagingException
getContentMD5
in class MimeMessage
MessagingException
protected InputStream getContentStream() throws MessagingException
getContentStream
in class MimeMessage
MessagingException
public String getContentType() throws MessagingException
getContentType
in class MimeMessage
MessagingException
public synchronized DataHandler getDataHandler() throws MessagingException
getDataHandler
in class MimeMessage
MessagingException
public String getDescription() throws MessagingException
getDescription
in class MimeMessage
MessagingException
public String getDisposition() throws MessagingException
getDisposition
in class MimeMessage
MessagingException
public String getEncoding() throws MessagingException
getEncoding
in class MimeMessage
MessagingException
protected int getFetchBlockSize()
public String getFileName() throws MessagingException
getFileName
in class MimeMessage
MessagingException
public synchronized Flags getFlags() throws MessagingException
getFlags
in class MimeMessage
MessagingException
public Address[] getFrom() throws MessagingException
getFrom
in class MimeMessage
MessagingException
public String[] getHeader(String name) throws MessagingException
getHeader
in class MimeMessage
name
MessagingException
public String getHeader(String name, String delimiter) throws MessagingException
getHeader
in class MimeMessage
name
delimiter
MessagingException
public String getInReplyTo() throws MessagingException
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
getLineCount
in class MimeMessage
MessagingException
public Enumeration getMatchingHeaderLines(String[] names) throws MessagingException
getMatchingHeaderLines
in class MimeMessage
names
MessagingException
public Enumeration getMatchingHeaders(String[] names) throws MessagingException
getMatchingHeaders
in class MimeMessage
names
MessagingException
protected Object getMessageCacheLock()
public String getMessageID() throws MessagingException
getMessageID
in class MimeMessage
MessagingException
public Enumeration getNonMatchingHeaderLines(String[] names) throws MessagingException
getNonMatchingHeaderLines
in class MimeMessage
names
MessagingException
public Enumeration getNonMatchingHeaders(String[] names) throws MessagingException
getNonMatchingHeaders
in class MimeMessage
names
MessagingException
public synchronized boolean getPeek()
protected IMAPProtocol getProtocol() throws ProtocolException, FolderClosedException
ProtocolException
FolderClosedException
public Date getReceivedDate() throws MessagingException
getReceivedDate
in class MimeMessage
MessagingException
public Address[] getRecipients(Message.RecipientType type) throws MessagingException
getRecipients
in class MimeMessage
type
MessagingException
public Address[] getReplyTo() throws MessagingException
getReplyTo
in class MimeMessage
MessagingException
public Address getSender() throws MessagingException
getSender
in class MimeMessage
MessagingException
public Date getSentDate() throws MessagingException
getSentDate
in class MimeMessage
MessagingException
protected int getSequenceNumber()
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.
getSize
in class MimeMessage
MessagingException
public String getSubject() throws MessagingException
getSubject
in class MimeMessage
MessagingException
protected long getUID()
public synchronized void invalidateHeaders()
protected boolean isREV1() throws FolderClosedException
FolderClosedException
public synchronized boolean isSet(Flags.Flag flag) throws MessagingException
isSet
in class MimeMessage
flag
MessagingException
public void removeHeader(String name) throws MessagingException
removeHeader
in class MimeMessage
name
MessagingException
public void setContentID(String cid) throws MessagingException
setContentID
in class MimeMessage
cid
MessagingException
public void setContentLanguage(String[] languages) throws MessagingException
setContentLanguage
in class MimeMessage
languages
MessagingException
public void setContentMD5(String md5) throws MessagingException
setContentMD5
in class MimeMessage
md5
MessagingException
public void setDataHandler(DataHandler content) throws MessagingException
setDataHandler
in class MimeMessage
content
MessagingException
public void setDescription(String description, String charset) throws MessagingException
setDescription
in class MimeMessage
description
charset
MessagingException
public void setDisposition(String disposition) throws MessagingException
setDisposition
in class MimeMessage
disposition
MessagingException
protected void setExpunged(boolean set)
setExpunged
in class Message
set
public void setFileName(String filename) throws MessagingException
setFileName
in class MimeMessage
filename
MessagingException
public synchronized void setFlags(Flags flag, boolean set) throws MessagingException
setFlags
in class MimeMessage
flag
set
MessagingException
public void setFrom(Address address) throws MessagingException
setFrom
in class MimeMessage
address
MessagingException
public void setHeader(String name, String value) throws MessagingException
setHeader
in class MimeMessage
name
value
MessagingException
protected void setMessageNumber(int msgnum)
setMessageNumber
in class Message
msgnum
public synchronized void setPeek(boolean peek)
peek
public void setRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException
setRecipients
in class MimeMessage
type
addresses
MessagingException
public void setReplyTo(Address[] addresses) throws MessagingException
setReplyTo
in class MimeMessage
addresses
MessagingException
public void setSender(Address address) throws MessagingException
setSender
in class MimeMessage
address
MessagingException
public void setSentDate(Date d) throws MessagingException
setSentDate
in class MimeMessage
d
MessagingException
protected void setSequenceNumber(int seqnum)
seqnum
public void setSubject(String subject, String charset) throws MessagingException
setSubject
in class MimeMessage
subject
charset
MessagingException
protected void setUID(long uid)
uid
public void writeTo(OutputStream os) throws IOException, MessagingException
writeTo
in class MimeMessage
os
IOException
MessagingException
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |