Top Description Fields Constructors Methods
com.sun.mail.imap

public Class IMAPNestedMessage

extends IMAPMessage
Class Inheritance
Imports
java.io.*, javax.mail.*, com.sun.mail.imap.protocol.*, com.sun.mail.iap.ProtocolException

This class implements a nested IMAP message
Author
John Mani

Field Summary

Modifier and TypeField and Description
private IMAPMessage
Inherited from com.sun.mail.imap.IMAPMessage:
bsenvelopeEnvelopeCmditemssectionId

Constructor Summary

AccessConstructor and Description
pack-priv
IMAPNestedMessage(IMAPMessage m, BODYSTRUCTURE b, ENVELOPE e, String sid)

Package private constructor.

Method Summary

Modifier and TypeMethod and Description
protected void
protected int
protected Object
getMessageCacheLock()

Overrides com.sun.mail.imap.IMAPMessage.getMessageCacheLock.

Get the messageCacheLock, associated with this Message's Folder.
protected IMAPProtocol
getProtocol()

Overrides com.sun.mail.imap.IMAPMessage.getProtocol.

Get this message's folder's protocol connection.
protected int
getSequenceNumber()

Overrides com.sun.mail.imap.IMAPMessage.getSequenceNumber.

Get this message's IMAP sequence number.
public int
getSize()

Overrides com.sun.mail.imap.IMAPMessage.getSize.

Implements javax.mail.Part.getSize.

Get the message size.
protected boolean
public boolean
isExpunged()

Overrides javax.mail.Message.isExpunged.

Checks whether this message is expunged.
protected boolean
public synchronized void
setFlags(Flags
Flags object containing the flags to be set
flag
,
boolean
the value to be set
set
)

Overrides com.sun.mail.imap.IMAPMessage.setFlags.

Set/Unset the given flags in this message.
Inherited from com.sun.mail.imap.IMAPMessage:
_getModSeq_getSession_setFlagsaddFromaddHeaderaddHeaderLineaddRecipientsfetchItemforceCheckExpungedgetAllHeaderLinesgetAllHeadersgetContentIDgetContentLanguagegetContentMD5getContentStreamgetContentTypegetDataHandlergetDescriptiongetDispositiongetEncodinggetFileNamegetFlagsgetFromgetHeadergetHeadergetInReplyTogetItemgetLineCountgetMatchingHeaderLinesgetMatchingHeadersgetMessageIDgetMimeStreamgetModSeqgetNonMatchingHeaderLinesgetNonMatchingHeadersgetPeekgetReceivedDategetRecipientsgetReplyTogetSendergetSentDategetSizeLonggetSubjectgetUIDhandleExtensionFetchItemshandleFetchIteminvalidateHeadersisSetremoveHeadersetContentIDsetContentLanguagesetContentMD5setDataHandlersetDescriptionsetDispositionsetExpungedsetFileNamesetFromsetHeadersetMessageNumbersetModSeqsetPeeksetRecipientssetReplyTosetSendersetSentDatesetSubjectsetUIDwriteTo

Field Detail

msgback to summary
private IMAPMessage msg

Constructor Detail

IMAPNestedMessageback to summary
pack-priv IMAPNestedMessage(IMAPMessage m, BODYSTRUCTURE b, ENVELOPE e, String sid)

Package private constructor.

Note that nested messages have no containing folder, nor a message number.

Method Detail

checkExpungedback to summary
protected void checkExpunged() throws MessageRemovedException

Overrides com.sun.mail.imap.IMAPMessage.checkExpunged.

Annotations
@Override
getFetchBlockSizeback to summary
protected int getFetchBlockSize()

Overrides com.sun.mail.imap.IMAPMessage.getFetchBlockSize.

Annotations
@Override
getMessageCacheLockback to summary
protected Object getMessageCacheLock()

Overrides com.sun.mail.imap.IMAPMessage.getMessageCacheLock.

Doc from com.sun.mail.imap.IMAPMessage.getMessageCacheLock.

Get the messageCacheLock, associated with this Message's Folder.

Returns:Object

the message cache lock object

Annotations
@Override
getProtocolback to summary
protected IMAPProtocol getProtocol() throws ProtocolException, FolderClosedException

Overrides com.sun.mail.imap.IMAPMessage.getProtocol.

Doc from com.sun.mail.imap.IMAPMessage.getProtocol.

Get this message's folder's protocol connection. Throws FolderClosedException, if the protocol connection is not available. ASSERT: Must hold the messageCacheLock.

Returns:IMAPProtocol

the IMAPProtocol object for the containing folder

Annotations
@Override
Exceptions
ProtocolException:
for protocol errors
FolderClosedException:
if the folder is closed
getSequenceNumberback to summary
protected int getSequenceNumber()

Overrides com.sun.mail.imap.IMAPMessage.getSequenceNumber.

Doc from com.sun.mail.imap.IMAPMessage.getSequenceNumber.

Get this message's IMAP sequence number. ASSERT: This method must be called only when holding the messageCacheLock.

Returns:int

the message sequence number

Annotations
@Override
getSizeback to summary
public int getSize() throws MessagingException

Overrides com.sun.mail.imap.IMAPMessage.getSize.

Implements javax.mail.Part.getSize.

Doc from com.sun.mail.imap.IMAPMessage.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.

Returns:int

Doc from javax.mail.internet.MimeMessage.getSize.

size of content in bytes

Annotations
@Override
Exceptions
MessagingException:

Doc from javax.mail.internet.MimeMessage.getSize.

for failures

ignoreBodyStructureSizeback to summary
protected boolean ignoreBodyStructureSize()

Overrides com.sun.mail.imap.IMAPMessage.ignoreBodyStructureSize.

Annotations
@Override
isExpungedback to summary
public boolean isExpunged()

Overrides javax.mail.Message.isExpunged.

Doc from javax.mail.Message.isExpunged.

Checks whether this message is expunged. All other methods except getMessageNumber() are invalid on an expunged Message object.

Messages that are expunged due to an explict expunge() request on the containing Folder are removed from the Folder immediately. Messages that are externally expunged by another source are marked "expunged" and return true for the isExpunged() method, but they are not removed from the Folder until an explicit expunge() is done on the Folder.

See the description of expunge() for more details on expunge handling.

Returns:boolean

true if the message is expunged

Annotations
@Override
isREV1back to summary
protected boolean isREV1() throws FolderClosedException

Overrides com.sun.mail.imap.IMAPMessage.isREV1.

Annotations
@Override
setFlagsback to summary
public synchronized void setFlags(Flags flag, boolean set) throws MessagingException

Overrides com.sun.mail.imap.IMAPMessage.setFlags.

Doc from com.sun.mail.imap.IMAPMessage.setFlags.

Set/Unset the given flags in this message.

Parameters
flag:Flags

Doc from javax.mail.Message.setFlags.

Flags object containing the flags to be set

set:boolean

Doc from javax.mail.Message.setFlags.

the value to be set

Annotations
@Override
Exceptions
MessagingException:

Doc from javax.mail.internet.MimeMessage.setFlags.

for other failures