|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.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 Messagevalue - The new expunge setting.
public Flags getFlags()
throws MessagingException
getFlags in class MimeMessageMessagingException - if there was a problem accessing the Store
public boolean isSet(Flags.Flag flag)
throws MessagingException
getFlags().
isSet in class MimeMessageflag - the flags to check for
MessagingException - if there was a problem accessing the Store
public void setFlags(Flags flag,
boolean set)
throws MessagingException
setFlags in class MimeMessageflags - 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 MimeMessageMessagingExceptionMimeMessage.getContentStream()
public void writeTo(OutputStream out)
throws IOException,
MessagingException
writeTo in interface PartwriteTo in class MimeMessageout - The target stream.
IOException
MessagingException
public Address[] getFrom()
throws MessagingException
getFrom in class MimeMessageMessagingException
public Address getSender()
throws MessagingException
getSender in class MimeMessageMessagingException - if there was a problem parsing the header
public Address[] getRecipients(Message.RecipientType type)
throws MessagingException
getRecipients in class MimeMessagetype - The message RecipientType identifier.
MessagingException
public Address[] getReplyTo()
throws MessagingException
getReplyTo in class MimeMessageMessagingException
public String getSubject()
throws MessagingException
getSubject in class MimeMessageMessagingException
public Date getSentDate()
throws MessagingException
getSentDate in class MimeMessageMessagingException
public Date getReceivedDate()
throws MessagingException
getReceivedDate in class MimeMessageMessagingException
public int getSize()
throws MessagingException
getSize in interface PartgetSize in class MimeMessageMessagingException
public int getLineCount()
throws MessagingException
getLineCount in interface PartgetLineCount in class MimeMessageMessagingException
public String getInReplyTo()
throws MessagingException
MessagingException
public String getContentType()
throws MessagingException
getContentType in interface PartgetContentType in class MimeMessageMessagingException
public boolean isMimeType(String type)
throws MessagingException
isMimeType in interface PartisMimeType in class MimeMessagetype - The tested type name.
MessagingException
public String getDisposition()
throws MessagingException
getDisposition in interface PartgetDisposition in class MimeMessageMessagingException
public String getEncoding()
throws MessagingException
getEncoding in interface MimePartgetEncoding in class MimeMessageMessagingException
public String getContentID()
throws MessagingException
getContentID in interface MimePartgetContentID in class MimeMessageMessagingException
public String getContentMD5()
throws MessagingException
getContentMD5 in interface MimePartgetContentMD5 in class MimeMessageMessagingException
public String getDescription()
throws MessagingException
getDescription in interface PartgetDescription in class MimeMessageMessagingException
public String[] getContentLanguage()
throws MessagingException
getContentLanguage in interface MimePartgetContentLanguage in class MimeMessageMessagingException
public String getMessageID()
throws MessagingException
getMessageID in class MimeMessageMessagingException
public void setFrom(Address address)
throws MessagingException
setFrom in class MimeMessageMessagingException
public void addFrom(Address[] address)
throws MessagingException
addFrom in class MimeMessageMessagingException
public void setSender(Address address)
throws MessagingException
setSender in class MimeMessageMessagingException
public void setRecipients(Message.RecipientType type,
Address[] addresses)
throws MessagingException
setRecipients in class MimeMessageMessagingException
public void setRecipients(Message.RecipientType type,
String address)
throws MessagingException
setRecipients in class MimeMessageMessagingException
public void addRecipients(Message.RecipientType type,
Address[] address)
throws MessagingException
addRecipients in class MimeMessageMessagingException
public void setReplyTo(Address[] address)
throws MessagingException
setReplyTo in class MimeMessageMessagingException
public void setSubject(String subject)
throws MessagingException
setSubject in class MimeMessageMessagingException
public void setSubject(String subject,
String charset)
throws MessagingException
setSubject in class MimeMessageMessagingException
public void setSentDate(Date sent)
throws MessagingException
setSentDate in class MimeMessageMessagingException
public void setDisposition(String disposition)
throws MessagingException
setDisposition in interface PartsetDisposition in class MimeMessageMessagingException
public void setContentID(String cid)
throws MessagingException
setContentID in class MimeMessageMessagingException
public void setContentMD5(String md5)
throws MessagingException
setContentMD5 in interface MimePartsetContentMD5 in class MimeMessageMessagingException
public void setDescription(String description)
throws MessagingException
setDescription in interface PartsetDescription in class MimeMessageMessagingException
public void setDescription(String description,
String charset)
throws MessagingException
setDescription in class MimeMessageMessagingException
public void setContentLanguage(String[] languages)
throws MessagingException
setContentLanguage in interface MimePartsetContentLanguage in class MimeMessageMessagingException
public String[] getHeader(String name)
throws MessagingException
getHeader in interface PartgetHeader in class MimeMessageMessagingException
public String getHeader(String name,
String delimiter)
throws MessagingException
getHeader in interface MimePartgetHeader in class MimeMessageMessagingException
public Enumeration getAllHeaders()
throws MessagingException
getAllHeaders in interface PartgetAllHeaders in class MimeMessageMessagingException
public Enumeration getMatchingHeaders(String[] names)
throws MessagingException
getMatchingHeaders in interface PartgetMatchingHeaders in class MimeMessageMessagingException
public Enumeration getNonMatchingHeaders(String[] names)
throws MessagingException
getNonMatchingHeaders in interface PartgetNonMatchingHeaders in class MimeMessageMessagingException
public Enumeration getAllHeaderLines()
throws MessagingException
getAllHeaderLines in interface MimePartgetAllHeaderLines in class MimeMessageMessagingException
public Enumeration getMatchingHeaderLines(String[] names)
throws MessagingException
getMatchingHeaderLines in interface MimePartgetMatchingHeaderLines in class MimeMessageMessagingException
public Enumeration getNonMatchingHeaderLines(String[] names)
throws MessagingException
getNonMatchingHeaderLines in interface MimePartgetNonMatchingHeaderLines in class MimeMessageMessagingException
public void addHeader(String name,
String value)
throws MessagingException
addHeader in interface PartaddHeader in class MimeMessageMessagingException
public void setHeader(String name,
String value)
throws MessagingException
setHeader in interface PartsetHeader in class MimeMessageMessagingException
public void removeHeader(String name)
throws MessagingException
removeHeader in interface PartremoveHeader in class MimeMessageMessagingException
public void addHeaderLine(String line)
throws MessagingException
addHeaderLine in interface MimePartaddHeaderLine in class MimeMessageMessagingException
public void saveChanges()
throws MessagingException
saveChanges in class MimeMessageMessagingException
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 PartgetDataHandler in class MimeMessageMessagingException
public void setDataHandler(DataHandler content)
throws MessagingException
setDataHandler in interface PartsetDataHandler in class MimeMessageMessagingException
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
MessagingExceptionprotected 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 | |||||||||