- All Implemented Interfaces:
MimePart,Part,ReadableMime
- Direct Known Subclasses:
GmailMessage
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 ClassesModifier and TypeClassDescriptionstatic classThis class implements the test to be done on each message in the folder.Nested classes/interfaces inherited from class jakarta.mail.internet.MimeMessage
MimeMessage.RecipientType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.eclipse.angus.mail.imap.protocol.BODYSTRUCTUREprotected org.eclipse.angus.mail.imap.protocol.ENVELOPEA map of the extension FETCH items.protected StringFields inherited from class jakarta.mail.internet.MimeMessage
cachedContent, content, contentStream, dh, flags, headers, modified, savedFields inherited from interface jakarta.mail.Part
ATTACHMENT, INLINE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedIMAPMessage(Session session) Constructor, for use by IMAPNestedMessage.protectedIMAPMessage(IMAPFolder folder, int msgnum) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the specified addresses to the existing "From" field.voidAdd this value to the existing values for this header_name.voidaddHeaderLine(String line) Add a raw RFC 822 header-line.voidaddRecipients(Message.RecipientType type, Address[] addresses) Add the given addresses to the specified recipient type.protected voidprotected ObjectfetchItem(org.eclipse.angus.mail.imap.protocol.FetchItem fitem) Fetch an individual item for the current message.protected voidDo a NOOP to force any untagged EXPUNGE responses and then check if this message is expunged.Get all header-lines.Get all headers.Get the Content-ID.String[]Get the content language.Get the Content-MD5.protected InputStreamGet all the bytes for this message.Get the Content-Type.jakarta.activation.DataHandlerGet the DataHandler object for this message.Get the decoded Content-Description.Get the Content-Disposition.Get the Content-Transfer-Encoding.protected intGet the "filename" Disposition parameter.getFlags()Get the Flags for this message.Address[]getFrom()Get the "From" attribute.String[]Get the named header.Get the named header.Get the In-Reply-To header.getItem(org.eclipse.angus.mail.imap.protocol.FetchItem fitem) Return the data associated with the FetchItem.intGet the total number of lines.getMatchingHeaderLines(String[] names) Get all matching header-lines.getMatchingHeaders(String[] names) Get matching headers.protected ObjectGet the messageCacheLock, associated with this Message's Folder.Get the Message-ID.Return the MIME format stream corresponding to this message.longReturn the modification sequence number (MODSEQ) for this message.getNonMatchingHeaderLines(String[] names) Get all non-matching headerlines.getNonMatchingHeaders(String[] names) Get non-matching headers.booleangetPeek()Get whether or not to use the PEEK variant of FETCH when fetching message content.protected org.eclipse.angus.mail.imap.protocol.IMAPProtocolGet this message's folder's protocol connection.Get the received date (INTERNALDATE).Address[]Get the desired Recipient type.Address[]Get the ReplyTo addresses.Get the "Sender" attribute.Get the SentDate.protected intGet this message's IMAP sequence number.intgetSize()Get the message size.longGet the message size as a long.Get the decoded subject.protected longgetUID()Return the UID for this message.protected voidhandleExtensionFetchItems(Map<String, Object> extensionItems) Apply the data in the extension FETCH items to this message.protected booleanhandleFetchItem(org.eclipse.angus.mail.imap.protocol.Item item, String[] hdrs, boolean allHeaders) Apply the data in the FETCH item to this message.protected booleanvoidInvalidate cached header and envelope information for this message.protected booleanisREV1()booleanisSet(Flags.Flag flag) Test if the given Flags are set in this message.voidremoveHeader(String name) Remove all headers with this name.voidsetContentID(String cid) Set the "Content-ID" header field of this Message.voidsetContentLanguage(String[] languages) Set the "Content-Language" header of this MimePart.voidsetContentMD5(String md5) Set the "Content-MD5" header field of this Message.voidsetDataHandler(jakarta.activation.DataHandler content) This method provides the mechanism to set this part's content.voidsetDescription(String description, String charset) Set the "Content-Description" header field for this Message.voidsetDisposition(String disposition) Set the disposition in the "Content-Disposition" header field of this body part.protected voidsetExpunged(boolean set) Sets the expunged flag for this Message.voidsetFileName(String filename) Set the filename associated with this part, if possible.voidSet/Unset the given flags in this message.voidSet the RFC 822 "From" header field.voidSet the value for this header_name.protected voidsetMessageNumber(int msgnum) Wrapper around the protected method Message.setMessageNumber() to make that method accessible to IMAPFolder.voidsetPeek(boolean peek) Set whether or not to use the PEEK variant of FETCH when fetching message content.voidsetRecipients(Message.RecipientType type, Address[] addresses) Set the specified recipient type to the given addresses.voidsetReplyTo(Address[] addresses) Set the RFC 822 "Reply-To" header field.voidSet the RFC 822 "Sender" header field.voidsetSentDate(Date d) Set the RFC 822 "Date" header field.voidsetSubject(String subject, String charset) Set the "Subject" header field.protected voidsetUID(long uid) voidwriteTo(OutputStream os) Write out the bytes into the given OutputStream.Methods inherited from class jakarta.mail.internet.MimeMessage
addRecipients, createInternetHeaders, createMimeMessage, getAllRecipients, getContent, getInputStream, getRawInputStream, isMimeType, parse, reply, reply, saveChanges, setContent, setContent, setDescription, setFrom, setFrom, setRecipients, setSubject, setText, setText, setText, updateHeaders, updateMessageID, writeToMethods inherited from class jakarta.mail.Message
addRecipient, getFolder, getMessageNumber, getSession, getStreamProvider, isExpunged, match, setFlag, setRecipientMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.mail.Part
getStreamProvider
-
Field Details
-
bs
protected org.eclipse.angus.mail.imap.protocol.BODYSTRUCTURE bs -
envelope
protected org.eclipse.angus.mail.imap.protocol.ENVELOPE envelope -
items
A map of the extension FETCH items. In addition to saving the data in this map, an entry in this map indicates that we *have* the data, and so it doesn't need to be fetched again. The map is created only when needed, to avoid significantly increasing the effective size of an IMAPMessage object.- Since:
- JavaMail 1.4.6
-
sectionId
-
-
Constructor Details
-
IMAPMessage
Constructor.- Parameters:
folder- the folder containing this messagemsgnum- the message sequence number
-
IMAPMessage
Constructor, for use by IMAPNestedMessage.- Parameters:
session- the Session
-
-
Method Details
-
getProtocol
protected org.eclipse.angus.mail.imap.protocol.IMAPProtocol getProtocol() throws org.eclipse.angus.mail.iap.ProtocolException, FolderClosedExceptionGet this message's folder's protocol connection. Throws FolderClosedException, if the protocol connection is not available. ASSERT: Must hold the messageCacheLock.- Returns:
- the IMAPProtocol object for the containing folder
- Throws:
org.eclipse.angus.mail.iap.ProtocolException- for protocol errorsFolderClosedException- if the folder is closed
-
isREV1
- Throws:
FolderClosedException
-
getMessageCacheLock
Get the messageCacheLock, associated with this Message's Folder.- Returns:
- the message cache lock object
-
getSequenceNumber
protected int getSequenceNumber()Get this message's IMAP sequence number. ASSERT: This method must be called only when holding the messageCacheLock.- Returns:
- the message sequence number
-
setMessageNumber
protected void setMessageNumber(int msgnum) Wrapper around the protected method Message.setMessageNumber() to make that method accessible to IMAPFolder.- Overrides:
setMessageNumberin classMessage- Parameters:
msgnum- the message number
-
getUID
protected long getUID()Return the UID for this message. Returns -1 if not known; use UIDFolder.getUID() in this case.- Returns:
- the UID
- See Also:
-
setUID
protected void setUID(long uid) -
getModSeq
Return the modification sequence number (MODSEQ) for this message. Returns -1 if not known.- Returns:
- the modification sequence number
- Throws:
MessagingException- for failures- Since:
- JavaMail 1.5.1
- See Also:
-
- "RFC 4551"
-
setExpunged
protected void setExpunged(boolean set) Description copied from class:MessageSets the expunged flag for this Message. This method is to be used only by the implementation classes.- Overrides:
setExpungedin classMessage- Parameters:
set- the expunged flag
-
checkExpunged
- Throws:
MessageRemovedException
-
forceCheckExpunged
Do a NOOP to force any untagged EXPUNGE responses and then check if this message is expunged.- Throws:
MessageRemovedException- if the message has been removedFolderClosedException- if the folder has been closed
-
getFetchBlockSize
protected int getFetchBlockSize() -
ignoreBodyStructureSize
protected boolean ignoreBodyStructureSize() -
getFrom
Get the "From" attribute.- Overrides:
getFromin classMimeMessage- Returns:
- Address object
- Throws:
MessagingException- for failures- See Also:
-
setFrom
Description copied from class:MimeMessageSet the RFC 822 "From" header field. Any existing values are replaced with the given address. If address isnull, this header is removed.- Overrides:
setFromin classMimeMessage- Parameters:
address- the sender of this message- Throws:
IllegalWriteException- if the underlying implementation does not support modification of existing valuesMessagingException- for other failures
-
addFrom
Description copied from class:MimeMessageAdd the specified addresses to the existing "From" field. If the "From" field does not already exist, it is created.- Overrides:
addFromin classMimeMessage- Parameters:
addresses- the senders of this message- Throws:
IllegalWriteException- if the underlying implementation does not support modification of existing valuesMessagingException- for other failures
-
getSender
Get the "Sender" attribute.- Overrides:
getSenderin classMimeMessage- Returns:
- Address object
- Throws:
MessagingException- for failures- See Also:
-
setSender
Description copied from class:MimeMessageSet the RFC 822 "Sender" header field. Any existing values are replaced with the given address. If address isnull, this header is removed.- Overrides:
setSenderin classMimeMessage- Parameters:
address- the sender of this message- Throws:
IllegalWriteException- if the underlying implementation does not support modification of existing valuesMessagingException- for other failures
-
getRecipients
Get the desired Recipient type.- Overrides:
getRecipientsin classMimeMessage- Parameters:
type- Type of recepient- Returns:
- array of Address objects
- Throws:
MessagingException- if header could not be retrievedAddressException- if the header is misformatted- See Also:
-
setRecipients
public void setRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException Description copied from class:MimeMessageSet the specified recipient type to the given addresses. If the address parameter isnull, the corresponding recipient field is removed.- Overrides:
setRecipientsin classMimeMessage- Parameters:
type- Recipient typeaddresses- Addresses- Throws:
IllegalWriteException- if the underlying implementation does not support modification of existing valuesMessagingException- for other failures- See Also:
-
addRecipients
public void addRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException Description copied from class:MimeMessageAdd the given addresses to the specified recipient type.- Overrides:
addRecipientsin classMimeMessage- Parameters:
type- Recipient typeaddresses- Addresses- Throws:
IllegalWriteException- if the underlying implementation does not support modification of existing valuesMessagingException- for other failures
-
getReplyTo
Get the ReplyTo addresses.- Overrides:
getReplyToin classMimeMessage- Returns:
- addresses to which replies should be directed
- Throws:
MessagingException- for failures- See Also:
-
setReplyTo
Description copied from class:MimeMessageSet the RFC 822 "Reply-To" header field. If the address parameter isnull, this header is removed.- Overrides:
setReplyToin classMimeMessage- Parameters:
addresses- addresses to which replies should be directed- Throws:
IllegalWriteException- if the underlying implementation does not support modification of existing valuesMessagingException- for other failures
-
getSubject
Get the decoded subject.- Overrides:
getSubjectin classMimeMessage- Returns:
- Subject
- Throws:
MessagingException- for failures- See Also:
-
setSubject
Description copied from class:MimeMessageSet the "Subject" header field. If the subject contains non US-ASCII characters, it will be encoded using the specified charset. If the subject contains only US-ASCII characters, no encoding is done and it is used as-is. If the subject is null, the existing "Subject" header field is removed.The application must ensure that the subject does not contain any line breaks.
Note that if the charset encoding process fails, a MessagingException is thrown, and an UnsupportedEncodingException is included in the chain of nested exceptions within the MessagingException.
- Overrides:
setSubjectin classMimeMessage- Parameters:
subject- The subjectcharset- The charset- Throws:
IllegalWriteException- if the underlying implementation does not support modification of existing valuesMessagingException- for other failures
-
getSentDate
Get the SentDate.- Overrides:
getSentDatein classMimeMessage- Returns:
- The sent Date
- Throws:
MessagingException- for failures
-
setSentDate
Description copied from class:MimeMessageSet the RFC 822 "Date" header field. This is the date on which the creator of the message indicates that the message is complete and ready for delivery. If the date parameter isnull, the existing "Date" field is removed.- Overrides:
setSentDatein classMimeMessage- Parameters:
d- the sent date of this message- Throws:
IllegalWriteException- if the underlying implementation does not support modificationMessagingException- for other failures
-
getReceivedDate
Get the received date (INTERNALDATE).- Overrides:
getReceivedDatein classMimeMessage- Returns:
- the date this message was received
- Throws:
MessagingException- for failures
-
getSize
Get the message size.Note that this returns RFC822.SIZE. That is, it's the size of the whole message, header and body included. Note also that if the size of the message is greater than Integer.MAX_VALUE (2GB), this method returns Integer.MAX_VALUE.
- Specified by:
getSizein interfacePart- Overrides:
getSizein classMimeMessage- Returns:
- size of content in bytes
- Throws:
MessagingException- for failures
-
getSizeLong
Get the message size as a long.Suitable for messages that might be larger than 2GB.
- Returns:
- the message size as a long integer
- Throws:
MessagingException- for failures- Since:
- JavaMail 1.6
-
getLineCount
Get the total number of lines.Returns the "body_fld_lines" field from the BODYSTRUCTURE. Note that this field is available only for text/plain and message/rfc822 types
- Specified by:
getLineCountin interfacePart- Overrides:
getLineCountin classMimeMessage- Returns:
- number of lines in the content.
- Throws:
MessagingException- for failures
-
getContentLanguage
Get the content language.- Specified by:
getContentLanguagein interfaceMimePart- Overrides:
getContentLanguagein classMimeMessage- Returns:
- value of content-language header.
- Throws:
MessagingException- for failures
-
setContentLanguage
Description copied from class:MimeMessageSet the "Content-Language" header of this MimePart. The Content-Language header is defined by RFC 1766.- Specified by:
setContentLanguagein interfaceMimePart- Overrides:
setContentLanguagein classMimeMessage- Parameters:
languages- array of language tags- Throws:
IllegalWriteException- if the underlying implementation does not support modificationMessagingException- for other failures
-
getInReplyTo
Get the In-Reply-To header.- Returns:
- the In-Reply-To header
- Throws:
MessagingException- for failures- Since:
- JavaMail 1.3.3
-
getContentType
Get the Content-Type. Generate this header from the BODYSTRUCTURE. Append parameters as well.- Specified by:
getContentTypein interfacePart- Overrides:
getContentTypein classMimeMessage- Returns:
- The ContentType of this part
- Throws:
MessagingException- for failures- See Also:
-
DataHandler
-
getDisposition
Get the Content-Disposition.- Specified by:
getDispositionin interfacePart- Overrides:
getDispositionin classMimeMessage- Returns:
- disposition of this part, or null if unknown
- Throws:
MessagingException- for failures- See Also:
-
setDisposition
Description copied from class:MimeMessageSet the disposition in the "Content-Disposition" header field of this body part. If the disposition is null, any existing "Content-Disposition" header field is removed.- Specified by:
setDispositionin interfacePart- Overrides:
setDispositionin classMimeMessage- Parameters:
disposition- disposition of this part- Throws:
IllegalWriteException- if the underlying implementation does not support modificationMessagingException- for other failures- See Also:
-
getEncoding
Get the Content-Transfer-Encoding.- Specified by:
getEncodingin interfaceMimePart- Overrides:
getEncodingin classMimeMessage- Returns:
- content-transfer-encoding
- Throws:
MessagingException- for failures
-
getContentID
Get the Content-ID.- Specified by:
getContentIDin interfaceMimePart- Overrides:
getContentIDin classMimeMessage- Returns:
- content-ID
- Throws:
MessagingException- for failures
-
setContentID
Description copied from class:MimeMessageSet the "Content-ID" header field of this Message. If thecidparameter is null, any existing "Content-ID" is removed.- Overrides:
setContentIDin classMimeMessage- Parameters:
cid- the content ID- Throws:
IllegalWriteException- if the underlying implementation does not support modificationMessagingException- for other failures
-
getContentMD5
Get the Content-MD5.- Specified by:
getContentMD5in interfaceMimePart- Overrides:
getContentMD5in classMimeMessage- Returns:
- content-MD5
- Throws:
MessagingException- for failures
-
setContentMD5
Description copied from class:MimeMessageSet the "Content-MD5" header field of this Message.- Specified by:
setContentMD5in interfaceMimePart- Overrides:
setContentMD5in classMimeMessage- Parameters:
md5- the MD5 value- Throws:
IllegalWriteException- if the underlying implementation does not support modificationMessagingException- for other failures
-
getDescription
Get the decoded Content-Description.- Specified by:
getDescriptionin interfacePart- Overrides:
getDescriptionin classMimeMessage- Returns:
- content-description
- Throws:
MessagingException- for failures
-
setDescription
Description copied from class:MimeMessageSet the "Content-Description" header field for this Message. If the description parameter isnull, then any existing "Content-Description" fields are removed.If the description contains non US-ASCII characters, it will be encoded using the specified charset. If the description contains only US-ASCII characters, no encoding is done and it is used as-is.
Note that if the charset encoding process fails, a MessagingException is thrown, and an UnsupportedEncodingException is included in the chain of nested exceptions within the MessagingException.
- Overrides:
setDescriptionin classMimeMessage- Parameters:
description- Descriptioncharset- Charset for encoding- Throws:
IllegalWriteException- if the underlying implementation does not support modificationMessagingException- An UnsupportedEncodingException may be included in the exception chain if the charset conversion fails.
-
getMessageID
Get the Message-ID.- Overrides:
getMessageIDin classMimeMessage- Returns:
- Message-ID
- Throws:
MessagingException- if the retrieval of this field causes any exception.- See Also:
-
getFileName
Get the "filename" Disposition parameter. (Only available in IMAP4rev1). If thats not available, get the "name" ContentType parameter.- Specified by:
getFileNamein interfacePart- Overrides:
getFileNamein classMimeMessage- Returns:
- filename
- Throws:
MessagingException- for failures
-
setFileName
Description copied from class:MimeMessageSet the filename associated with this part, if possible.Sets the "filename" parameter of the "Content-Disposition" header field of this message.
If the
mail.mime.encodefilenameSystem property is set to true, theMimeUtility.encodeTextmethod will be used to encode the filename. While such encoding is not supported by the MIME spec, many mailers use this technique to support non-ASCII characters in filenames. The default value of this property is false.- Specified by:
setFileNamein interfacePart- Overrides:
setFileNamein classMimeMessage- Parameters:
filename- Filename to associate with this part- Throws:
IllegalWriteException- if the underlying implementation does not support modificationMessagingException- for other failures
-
getContentStream
Get all the bytes for this message. Overrides getContentStream() in MimeMessage. This method is ultimately used by the DataHandler to obtain the input stream for this message.- Overrides:
getContentStreamin classMimeMessage- Returns:
- an InputStream containing the raw bytes
- Throws:
MessagingException- for failures- See Also:
-
getDataHandler
Get the DataHandler object for this message.- Specified by:
getDataHandlerin interfacePart- Overrides:
getDataHandlerin classMimeMessage- Returns:
- DataHandler for the content
- Throws:
MessagingException- for failures
-
setDataHandler
Description copied from class:MimeMessageThis method provides the mechanism to set this part's content. The given DataHandler object should wrap the actual content.- Specified by:
setDataHandlerin interfacePart- Overrides:
setDataHandlerin classMimeMessage- Parameters:
content- The DataHandler for the content.- Throws:
IllegalWriteException- if the underlying implementation does not support modificationMessagingException- for other failures
-
getMimeStream
Return the MIME format stream corresponding to this message.- Specified by:
getMimeStreamin interfaceReadableMime- Returns:
- the MIME format stream
- Throws:
MessagingException- for failures- Since:
- JavaMail 1.4.5
-
writeTo
Write out the bytes into the given OutputStream.- Specified by:
writeToin interfacePart- Overrides:
writeToin classMimeMessage- Parameters:
os- the stream to write to- Throws:
IOException- if an error occurs writing to the stream or if an error is generated by the jakarta.activation layer.MessagingException- for other failures- See Also:
-
DataHandler.writeTo(java.io.OutputStream)
-
getHeader
Get the named header.- Specified by:
getHeaderin interfacePart- Overrides:
getHeaderin classMimeMessage- Parameters:
name- name of header- Returns:
- array of headers
- Throws:
MessagingException- for failures- See Also:
-
getHeader
Get the named header.- Specified by:
getHeaderin interfaceMimePart- Overrides:
getHeaderin classMimeMessage- Parameters:
name- the name of this headerdelimiter- separator between values- Returns:
- the value fields for all headers with this name
- Throws:
MessagingException- for failures
-
setHeader
Description copied from class:MimeMessageSet the value for this header_name. Replaces all existing header values with this new value. Note that RFC 822 headers must contain only US-ASCII characters, so a header that contains non US-ASCII characters must have been encoded by the caller as per the rules of RFC 2047.- Specified by:
setHeaderin interfacePart- Overrides:
setHeaderin classMimeMessage- Parameters:
name- header namevalue- header value- Throws:
IllegalWriteException- if the underlying implementation does not support modificationMessagingException- for other failures- See Also:
-
addHeader
Description copied from class:MimeMessageAdd this value to the existing values for this header_name. Note that RFC 822 headers must contain only US-ASCII characters, so a header that contains non US-ASCII characters must have been encoded as per the rules of RFC 2047.- Specified by:
addHeaderin interfacePart- Overrides:
addHeaderin classMimeMessage- Parameters:
name- header namevalue- header value- Throws:
IllegalWriteException- if the underlying implementation does not support modificationMessagingException- for other failures- See Also:
-
removeHeader
Description copied from class:MimeMessageRemove all headers with this name.- Specified by:
removeHeaderin interfacePart- Overrides:
removeHeaderin classMimeMessage- Parameters:
name- the name of this header- Throws:
IllegalWriteException- if the underlying implementation does not support modificationMessagingException- for other failures
-
getAllHeaders
Get all headers.- Specified by:
getAllHeadersin interfacePart- Overrides:
getAllHeadersin classMimeMessage- Returns:
- array of header objects
- Throws:
MessagingException- for failures- See Also:
-
getMatchingHeaders
Get matching headers.- Specified by:
getMatchingHeadersin interfacePart- Overrides:
getMatchingHeadersin classMimeMessage- Parameters:
names- the headers to match- Returns:
- enumeration of Header objects
- Throws:
MessagingException- for failures
-
getNonMatchingHeaders
Get non-matching headers.- Specified by:
getNonMatchingHeadersin interfacePart- Overrides:
getNonMatchingHeadersin classMimeMessage- Parameters:
names- the headers to not match- Returns:
- enumeration of Header objects
- Throws:
MessagingException- for failures
-
addHeaderLine
Description copied from class:MimeMessageAdd a raw RFC 822 header-line.- Specified by:
addHeaderLinein interfaceMimePart- Overrides:
addHeaderLinein classMimeMessage- Parameters:
line- the line to add- Throws:
IllegalWriteException- if the underlying implementation does not support modificationMessagingException- for other failures
-
getAllHeaderLines
Get all header-lines.- Specified by:
getAllHeaderLinesin interfaceMimePart- Overrides:
getAllHeaderLinesin classMimeMessage- Returns:
- an Enumeration of Strings
- Throws:
MessagingException- for failures
-
getMatchingHeaderLines
Get all matching header-lines.- Specified by:
getMatchingHeaderLinesin interfaceMimePart- Overrides:
getMatchingHeaderLinesin classMimeMessage- Parameters:
names- the headers to return- Returns:
- an Enumeration of Strings
- Throws:
MessagingException- for failures
-
getNonMatchingHeaderLines
Get all non-matching headerlines.- Specified by:
getNonMatchingHeaderLinesin interfaceMimePart- Overrides:
getNonMatchingHeaderLinesin classMimeMessage- Parameters:
names- the headers to not return- Returns:
- an Enumeration of Strings
- Throws:
MessagingException- for failures
-
getFlags
Get the Flags for this message.- Overrides:
getFlagsin classMimeMessage- Returns:
- Flags object containing the flags for this message
- Throws:
MessagingException- for failures- See Also:
-
isSet
Test if the given Flags are set in this message.- Overrides:
isSetin classMimeMessage- Parameters:
flag- the flag- Returns:
- value of the specified flag for this message
- Throws:
MessagingException- for failures- See Also:
-
setFlags
Set/Unset the given flags in this message.- Overrides:
setFlagsin classMimeMessage- Parameters:
flag- Flags object containing the flags to be setset- the value to be set- Throws:
IllegalWriteException- if the underlying implementation does not support modificationMessagingException- for other failures- See Also:
-
setPeek
public void setPeek(boolean peek) Set whether or not to use the PEEK variant of FETCH when fetching message content. This overrides the default value from the "mail.imap.peek" property.- Parameters:
peek- the peek flag- Since:
- JavaMail 1.3.3
-
getPeek
public boolean getPeek()Get whether or not to use the PEEK variant of FETCH when fetching message content.- Returns:
- the peek flag
- Since:
- JavaMail 1.3.3
-
invalidateHeaders
public void invalidateHeaders()Invalidate cached header and envelope information for this message. Subsequent accesses of this information will cause it to be fetched from the server.- Since:
- JavaMail 1.3.3
-
handleFetchItem
protected boolean handleFetchItem(org.eclipse.angus.mail.imap.protocol.Item item, String[] hdrs, boolean allHeaders) throws MessagingException Apply the data in the FETCH item to this message. ASSERT: Must hold the messageCacheLock.- Parameters:
item- the fetch itemhdrs- the headers we're asking forallHeaders- load all headers?- Returns:
- did we handle this fetch item?
- Throws:
MessagingException- for failures- Since:
- JavaMail 1.4.6
-
handleExtensionFetchItems
Apply the data in the extension FETCH items to this message. This method adds all the items to the items map. Subclasses may override this method to call super and then also copy the data to a more convenient form. ASSERT: Must hold the messageCacheLock.- Parameters:
extensionItems- the Map to add fetch items to- Since:
- JavaMail 1.4.6
-
fetchItem
protected Object fetchItem(org.eclipse.angus.mail.imap.protocol.FetchItem fitem) throws MessagingException Fetch an individual item for the current message. Note that handleExtensionFetchItems will have been called to store this item in the message before this method returns.- Parameters:
fitem- the FetchItem- Returns:
- the data associated with the FetchItem
- Throws:
MessagingException- for failures- Since:
- JavaMail 1.4.6
-
getItem
public Object getItem(org.eclipse.angus.mail.imap.protocol.FetchItem fitem) throws MessagingException Return the data associated with the FetchItem. If the data hasn't been fetched, call the fetchItem method to fetch it. Returns null if there is no data for the FetchItem.- Parameters:
fitem- the FetchItem- Returns:
- the data associated with the FetchItem
- Throws:
MessagingException- for failures- Since:
- JavaMail 1.4.6
-