public interface MessageResult extends Comparable<MessageResult>, MessageMetaData
Used to get specific informations about a Message without dealing with a MimeMessage instance. Demanded information can be requested by binary combining the constants.
I came to the Idea of the MessageResult because there are many possible combinations of different requests (uid, msn, MimeMessage, Flags).
e.g. I want to have all uids, msns and flags of all messages. (a common IMAP operation) Javamail would do it that way:
This means creating a lazy-loading MimeMessage instance. So why don't call getMessages(MessageResult.UID | MessageResult.MSN | MessageResult.FLAGS)? This would leave a lot of room for the implementation to optimize
| Modifier and Type | Interface and Description |
|---|---|
static interface |
MessageResult.FetchGroup
Indicates the results fetched.
|
static interface |
MessageResult.Header
A header.
|
static interface |
MessageResult.MimePath
Describes a path within a multipart MIME message.
|
| Modifier and Type | Method and Description |
|---|---|
Content |
getBody()
Gets the body of the message excluding headers.
|
Content |
getBody(MessageResult.MimePath path)
Gets the body of the given mime part.
|
Content |
getFullContent()
Gets the full message including headers and body.
|
Content |
getFullContent(MessageResult.MimePath path)
Gets the full content of the given mime part.
|
Headers |
getHeaders() |
Content |
getMimeBody(MessageResult.MimePath path)
Gets the body of the given mime part.
|
MimeDescriptor |
getMimeDescriptor() |
Iterator<MessageResult.Header> |
iterateHeaders(MessageResult.MimePath path)
Iterates the message headers for the given part in a multipart message.
|
Iterator<MessageResult.Header> |
iterateMimeHeaders(MessageResult.MimePath path)
Iterates the MIME headers for the given part in a multipart message.
|
compareTogetFlags, getInternalDate, getModSeq, getSize, getUidMimeDescriptor getMimeDescriptor() throws MailboxException
MailboxExceptionIterator<MessageResult.Header> iterateHeaders(MessageResult.MimePath path) throws MailboxException
path - describing the part's position within a multipart messageHeader Iterator, or null when
MessageResult.FetchGroup.content() does not include the index and
when the mime part cannot be foundMailboxExceptionIterator<MessageResult.Header> iterateMimeHeaders(MessageResult.MimePath path) throws MailboxException
path - describing the part's position within a multipart messageHeader Iterator, or null when
MessageResult.FetchGroup.content() does not include the index and
when the mime part cannot be foundMailboxExceptionContent getFullContent() throws MailboxException, IOException
Content, or or null if
MessageResult.FetchGroup.FULL_CONTENT has not been included in the
resultsIOExceptionMailboxExceptionContent getFullContent(MessageResult.MimePath path) throws MailboxException
path - describes the partContent, or null when
MessageResult.FetchGroup.content() did not been include the given
index and when the mime part cannot be foundMailboxExceptionContent getBody() throws MailboxException, IOException
Content, or or null if
MessageResult.FetchGroup.FULL_CONTENT has not been included in the
resultsIOExceptionMailboxExceptionContent getBody(MessageResult.MimePath path) throws MailboxException
path - describes the partContent, or null when
MessageResult.FetchGroup.content() did not been include the given
index and when the mime part cannot be foundMailboxExceptionContent getMimeBody(MessageResult.MimePath path) throws MailboxException
path - describes the partContent, or null when
MessageResult.FetchGroup.content() did not been include the given
index and when the mime part cannot be foundMailboxExceptionHeaders getHeaders() throws MailboxException
MailboxExceptionCopyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.