|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.mail.Message javax.mail.internet.MimeMessage org.apache.geronimo.javamail.store.imap.IMAPMessage
public class IMAPMessage
IMAP implementation of javax.mail.internet.MimeMessage Only the most basic information is given and Message objects created here is a light-weight reference to the actual Message As per the JavaMail spec items from the actual message will get filled up on demand If some other items are obtained from the server as a result of one call, then the other details are also processed and filled in. For ex if RETR is called then header information will also be processed in addition to the content
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.mail.internet.MimeMessage |
---|
MimeMessage.RecipientType |
Field Summary | |
---|---|
protected boolean |
allHeadersRetrieved
|
protected IMAPBodyStructure |
bodyStructure
|
protected static MailDateFormat |
dateFormat
|
protected IMAPEnvelope |
envelope
|
protected Date |
receivedDate
|
protected String |
section
|
protected int |
sequenceNumber
|
protected int |
size
|
protected IMAPStore |
store
|
protected long |
uid
|
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 |
Fields inherited from interface javax.mail.Part |
---|
ATTACHMENT, INLINE |
Method Summary | |
---|---|
void |
addFrom(Address[] address)
|
void |
addHeader(String name,
String value)
|
void |
addHeaderLine(String line)
|
void |
addRecipients(Message.RecipientType type,
Address[] address)
|
protected void |
checkValidity()
Check the validity of the current message. |
protected void |
checkValidity(boolean update)
Check the validity of the current message. |
protected boolean |
evaluateFetch(FetchProfile profile)
Evaluate whether this message requires any of the information in a FetchProfile to be fetched from the server. |
Enumeration |
getAllHeaderLines()
|
Enumeration |
getAllHeaders()
|
protected IMAPConnection |
getConnection()
get the current connection pool attached to the folder. |
String |
getContentID()
Retrieve the value of the "Content-ID" header. |
String[] |
getContentLanguage()
Return the content languages associated with this message. |
String |
getContentMD5()
|
protected InputStream |
getContentStream()
Return an InputStream instance for accessing the message content. |
String |
getContentType()
Returns the current content type (defined in the "Content-Type" header. |
DataHandler |
getDataHandler()
Create the DataHandler object for this message. |
String |
getDescription()
|
String |
getDisposition()
Retrieve the message "Content-Disposition" header field. |
String |
getEncoding()
Decode the Content-Transfer-Encoding header to determine the transfer encoding type. |
Flags |
getFlags()
Return a copy the flags associated with this message. |
Address[] |
getFrom()
Get the message "From" addresses. |
String[] |
getHeader(String name)
Following is a set of methods that deal with headers These methods are just overrides on the superclass methods to allow lazy loading of the header information. |
String |
getHeader(String name,
String delimiter)
|
String |
getInReplyTo()
Return the IMAP in reply to information (retrieved with the ENVELOPE). |
int |
getLineCount()
Get a line count for the IMAP message. |
Enumeration |
getMatchingHeaderLines(String[] names)
|
Enumeration |
getMatchingHeaders(String[] names)
|
String |
getMessageID()
|
Enumeration |
getNonMatchingHeaderLines(String[] names)
|
Enumeration |
getNonMatchingHeaders(String[] names)
|
Date |
getReceivedDate()
Get the message received date. |
Address[] |
getRecipients(Message.RecipientType type)
Gets the recipients by type. |
Address[] |
getReplyTo()
Get the ReplyTo address information. |
Address |
getSender()
Return the "Sender" header as an address. |
Date |
getSentDate()
Get the value of the "Date" header field. |
int |
getSize()
Retrieve the size of the message content. |
String |
getSubject()
Returns the value of the "Subject" header. |
boolean |
isMimeType(String type)
Tests to see if this message has a mime-type match with the given type name. |
boolean |
isSet(Flags.Flag flag)
Check whether the supplied flag is set. |
protected void |
loadBodyStructure()
Retrieve the BODYSTRUCTURE information from the IMAP server. |
protected void |
loadContent()
Load the message content into the Message object. |
protected void |
loadEnvelope()
Retrieve the message envelope from the IMAP server, synchronizing the headers with the information. |
void |
loadFlags()
Load the flag set for this message from the server. |
protected void |
loadHeaders()
Retrieve the message raw message headers from the IMAP server, synchronizing with the existing header set. |
protected void |
mergeHeaders(InternetHeaders newHeaders)
Merge a subset of the requested headers with our existing partial set. |
protected void |
releaseConnection(IMAPConnection connection)
Release the connection back to the Folder after performing an operation that requires a connection. |
void |
removeHeader(String name)
|
void |
saveChanges()
We cannot modify these messages |
void |
setContentID(String cid)
|
void |
setContentLanguage(String[] languages)
|
void |
setContentMD5(String md5)
|
void |
setDataHandler(DataHandler content)
|
void |
setDescription(String description)
|
void |
setDescription(String description,
String charset)
|
void |
setDisposition(String disposition)
|
void |
setExpunged(boolean value)
Override for the Message class setExpunged() method to allow us to do additional cleanup for expunged messages. |
void |
setFlags(Flags flag,
boolean set)
Set or clear a flag value. |
void |
setFrom(Address address)
|
void |
setHeader(String name,
String value)
|
void |
setRecipients(Message.RecipientType type,
Address[] addresses)
|
void |
setRecipients(Message.RecipientType type,
String address)
|
void |
setReplyTo(Address[] address)
|
void |
setSender(Address address)
|
void |
setSentDate(Date sent)
|
void |
setSubject(String subject)
|
void |
setSubject(String subject,
String charset)
|
protected void |
updateBodyStructure(IMAPBodyStructure structure)
Update the BODYSTRUCTURE information from the IMAP server. |
protected void |
updateEnvelope(IMAPEnvelope envelope)
Retrieve the message envelope from the IMAP server, synchronizing the headers with the information. |
protected void |
updateHeader(String header,
Address address)
Utility method for synchronizing IMAP envelope information and the message headers. |
protected void |
updateHeader(String header,
InternetAddress[] addresses)
Utility method for synchronizing IMAP envelope information and the message headers. |
protected void |
updateHeader(String header,
String value)
Utility method for synchronizing IMAP envelope information and the message headers. |
void |
updateHeaders(InputStream in)
Update the message headers from an input stream. |
void |
writeTo(OutputStream out)
Write out the byte data to the provided output stream. |
Methods inherited from class javax.mail.internet.MimeMessage |
---|
addRecipients, createInternetHeaders, createMimeMessage, getAllRecipients, getContent, getFileName, getInputStream, getRawInputStream, parse, reply, setContent, setContent, setFileName, setFrom, setText, setText, setText, updateHeaders, updateMessageID, writeTo |
Methods inherited from class javax.mail.Message |
---|
addRecipient, getFolder, getMessageNumber, isExpunged, match, setFlag, setMessageNumber, setRecipient |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected IMAPStore store
protected int sequenceNumber
protected long uid
protected String section
protected IMAPEnvelope envelope
protected IMAPBodyStructure bodyStructure
protected Date receivedDate
protected int size
protected boolean allHeadersRetrieved
protected static MailDateFormat dateFormat
Method Detail |
---|
public void setExpunged(boolean value)
setExpunged
in class Message
value
- The new expunge setting.public Flags getFlags() throws MessagingException
getFlags
in class MimeMessage
MessagingException
- if there was a problem accessing the Storepublic boolean isSet(Flags.Flag flag) throws MessagingException
getFlags()
.
isSet
in class MimeMessage
flag
- the flags to check for
MessagingException
- if there was a problem accessing the Storepublic void setFlags(Flags flag, boolean set) throws MessagingException
setFlags
in class MimeMessage
flags
- The set of flags to effect.set
- The value to set the flag to (true or false).
MessagingException
protected InputStream getContentStream() throws MessagingException
getContentStream
in class MimeMessage
MessagingException
MimeMessage.getContentStream()
public void writeTo(OutputStream out) throws IOException, MessagingException
writeTo
in interface Part
writeTo
in class MimeMessage
out
- The target stream.
IOException
MessagingException
public Address[] getFrom() throws MessagingException
getFrom
in class MimeMessage
MessagingException
public Address getSender() throws MessagingException
getSender
in class MimeMessage
MessagingException
- if there was a problem parsing the headerpublic Address[] getRecipients(Message.RecipientType type) throws MessagingException
getRecipients
in class MimeMessage
type
- The message RecipientType identifier.
MessagingException
public Address[] getReplyTo() throws MessagingException
getReplyTo
in class MimeMessage
MessagingException
public String getSubject() throws MessagingException
getSubject
in class MimeMessage
MessagingException
public Date getSentDate() throws MessagingException
getSentDate
in class MimeMessage
MessagingException
public Date getReceivedDate() throws MessagingException
getReceivedDate
in class MimeMessage
MessagingException
public int getSize() throws MessagingException
getSize
in interface Part
getSize
in class MimeMessage
MessagingException
public int getLineCount() throws MessagingException
getLineCount
in interface Part
getLineCount
in class MimeMessage
MessagingException
public String getInReplyTo() throws MessagingException
MessagingException
public String getContentType() throws MessagingException
getContentType
in interface Part
getContentType
in class MimeMessage
MessagingException
public boolean isMimeType(String type) throws MessagingException
isMimeType
in interface Part
isMimeType
in class MimeMessage
type
- The tested type name.
MessagingException
public String getDisposition() throws MessagingException
getDisposition
in interface Part
getDisposition
in class MimeMessage
MessagingException
public String getEncoding() throws MessagingException
getEncoding
in interface MimePart
getEncoding
in class MimeMessage
MessagingException
public String getContentID() throws MessagingException
getContentID
in interface MimePart
getContentID
in class MimeMessage
MessagingException
public String getContentMD5() throws MessagingException
getContentMD5
in interface MimePart
getContentMD5
in class MimeMessage
MessagingException
public String getDescription() throws MessagingException
getDescription
in interface Part
getDescription
in class MimeMessage
MessagingException
public String[] getContentLanguage() throws MessagingException
getContentLanguage
in interface MimePart
getContentLanguage
in class MimeMessage
MessagingException
public String getMessageID() throws MessagingException
getMessageID
in class MimeMessage
MessagingException
public void setFrom(Address address) throws MessagingException
setFrom
in class MimeMessage
MessagingException
public void addFrom(Address[] address) throws MessagingException
addFrom
in class MimeMessage
MessagingException
public void setSender(Address address) throws MessagingException
setSender
in class MimeMessage
MessagingException
public void setRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException
setRecipients
in class MimeMessage
MessagingException
public void setRecipients(Message.RecipientType type, String address) throws MessagingException
setRecipients
in class MimeMessage
MessagingException
public void addRecipients(Message.RecipientType type, Address[] address) throws MessagingException
addRecipients
in class MimeMessage
MessagingException
public void setReplyTo(Address[] address) throws MessagingException
setReplyTo
in class MimeMessage
MessagingException
public void setSubject(String subject) throws MessagingException
setSubject
in class MimeMessage
MessagingException
public void setSubject(String subject, String charset) throws MessagingException
setSubject
in class MimeMessage
MessagingException
public void setSentDate(Date sent) throws MessagingException
setSentDate
in class MimeMessage
MessagingException
public void setDisposition(String disposition) throws MessagingException
setDisposition
in interface Part
setDisposition
in class MimeMessage
MessagingException
public void setContentID(String cid) throws MessagingException
setContentID
in class MimeMessage
MessagingException
public void setContentMD5(String md5) throws MessagingException
setContentMD5
in interface MimePart
setContentMD5
in class MimeMessage
MessagingException
public void setDescription(String description) throws MessagingException
setDescription
in interface Part
setDescription
in class MimeMessage
MessagingException
public void setDescription(String description, String charset) throws MessagingException
setDescription
in class MimeMessage
MessagingException
public void setContentLanguage(String[] languages) throws MessagingException
setContentLanguage
in interface MimePart
setContentLanguage
in class MimeMessage
MessagingException
public String[] getHeader(String name) throws MessagingException
getHeader
in interface Part
getHeader
in class MimeMessage
MessagingException
public String getHeader(String name, String delimiter) throws MessagingException
getHeader
in interface MimePart
getHeader
in class MimeMessage
MessagingException
public Enumeration getAllHeaders() throws MessagingException
getAllHeaders
in interface Part
getAllHeaders
in class MimeMessage
MessagingException
public Enumeration getMatchingHeaders(String[] names) throws MessagingException
getMatchingHeaders
in interface Part
getMatchingHeaders
in class MimeMessage
MessagingException
public Enumeration getNonMatchingHeaders(String[] names) throws MessagingException
getNonMatchingHeaders
in interface Part
getNonMatchingHeaders
in class MimeMessage
MessagingException
public Enumeration getAllHeaderLines() throws MessagingException
getAllHeaderLines
in interface MimePart
getAllHeaderLines
in class MimeMessage
MessagingException
public Enumeration getMatchingHeaderLines(String[] names) throws MessagingException
getMatchingHeaderLines
in interface MimePart
getMatchingHeaderLines
in class MimeMessage
MessagingException
public Enumeration getNonMatchingHeaderLines(String[] names) throws MessagingException
getNonMatchingHeaderLines
in interface MimePart
getNonMatchingHeaderLines
in class MimeMessage
MessagingException
public void addHeader(String name, String value) throws MessagingException
addHeader
in interface Part
addHeader
in class MimeMessage
MessagingException
public void setHeader(String name, String value) throws MessagingException
setHeader
in interface Part
setHeader
in class MimeMessage
MessagingException
public void removeHeader(String name) throws MessagingException
removeHeader
in interface Part
removeHeader
in class MimeMessage
MessagingException
public void addHeaderLine(String line) throws MessagingException
addHeaderLine
in interface MimePart
addHeaderLine
in class MimeMessage
MessagingException
public void saveChanges() throws MessagingException
saveChanges
in class MimeMessage
MessagingException
protected void updateHeader(String header, InternetAddress[] addresses) throws MessagingException
header
- The target header name.addresses
- The update addresses.
MessagingException
protected void updateHeader(String header, Address address) throws MessagingException
header
- The target header name.address
- The update address.
MessagingException
protected void updateHeader(String header, String value) throws MessagingException
header
- The target header name.value
- The update value.
MessagingException
public DataHandler getDataHandler() throws MessagingException
getDataHandler
in interface Part
getDataHandler
in class MimeMessage
MessagingException
public void setDataHandler(DataHandler content) throws MessagingException
setDataHandler
in interface Part
setDataHandler
in class MimeMessage
MessagingException
public void updateHeaders(InputStream in) throws MessagingException
in
- The InputStream source for the header information.
MessagingException
public void loadFlags() throws MessagingException
MessagingeException
MessagingException
protected void loadHeaders() throws MessagingException
MessagingException
protected void loadEnvelope() throws MessagingException
MessagingException
protected void updateEnvelope(IMAPEnvelope envelope) throws MessagingException
MessagingException
protected void loadBodyStructure() throws MessagingException
MessagingException
protected void updateBodyStructure(IMAPBodyStructure structure) throws MessagingException
MessagingException
protected void loadContent() throws MessagingException
MessagingException
protected IMAPConnection getConnection() throws MessagingException
MessagingException
protected void releaseConnection(IMAPConnection connection) throws MessagingException
connection
- The previously acquired connection.
MessagingException
protected void checkValidity() throws MessagingException
MessagingException
protected void checkValidity(boolean update) throws MessagingException
MessagingException
protected boolean evaluateFetch(FetchProfile profile)
profile
- The FetchProfile indicating the information that should be prefetched.
protected void mergeHeaders(InternetHeaders newHeaders)
newHeaders
- The retrieved set of headers.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |