| java.lang.Object | |||
| ↳ | com.google.code.javax.mail.Message | ||
| ↳ | com.google.code.javax.mail.internet.MimeMessage | ||
| ↳ | com.google.code.com.sun.mail.imap.IMAPMessage | ||
Known Direct Subclasses
|
This class implements an IMAPMessage object.
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.
|
[Expand]
Inherited Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.google.code.javax.mail.Part
| |||||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| EnvelopeCmd | |||||||||||
| bs | |||||||||||
| description | |||||||||||
| envelope | |||||||||||
| headersLoaded | |||||||||||
| loadedHeaders | |||||||||||
| peek | |||||||||||
| receivedDate | |||||||||||
| sectionId | |||||||||||
| size | |||||||||||
| subject | |||||||||||
| type | |||||||||||
| uid | |||||||||||
| x_gm_labels | |||||||||||
| x_gm_msgid | |||||||||||
| x_gm_thrid | |||||||||||
|
[Expand]
Inherited Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.code.javax.mail.internet.MimeMessage
| |||||||||||
From class
com.google.code.javax.mail.Message
| |||||||||||
| Protected Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructor.
| |||||||||||
Constructor, for use by IMAPNestedMessage.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Add the specified addresses to the existing "From" field.
| |||||||||||
Add this value to the existing values for this header_name.
| |||||||||||
Add a raw RFC 822 header-line.
| |||||||||||
Add the given addresses to the specified recipient type.
| |||||||||||
Get all header-lines.
| |||||||||||
Get all headers.
| |||||||||||
Get the Content-ID.
| |||||||||||
Get the content language.
| |||||||||||
Get the Content-MD5.
| |||||||||||
Get the Content-Type.
| |||||||||||
Get the DataHandler object for this message.
| |||||||||||
Get the decoded Content-Description.
| |||||||||||
Get the Content-Disposition.
| |||||||||||
Get the Content-Transfer-Encoding.
| |||||||||||
Get the "filename" Disposition parameter.
| |||||||||||
Get the Flags for this message.
| |||||||||||
Get the "From" attribute.
| |||||||||||
Get the named header.
| |||||||||||
Get the named header.
| |||||||||||
Get the In-Reply-To header.
| |||||||||||
Get the total number of lines.
| |||||||||||
Get all matching header-lines.
| |||||||||||
Get matching headers.
| |||||||||||
Get the Message-ID.
| |||||||||||
Get all non-matching headerlines.
| |||||||||||
Get non-matching headers.
| |||||||||||
Get whether or not to use the PEEK variant of FETCH when
fetching message content.
| |||||||||||
Get the recieved date (INTERNALDATE)
| |||||||||||
Get the desired Recipient type.
| |||||||||||
Get the ReplyTo addresses.
| |||||||||||
Get the "Sender" attribute.
| |||||||||||
Get the SentDate.
| |||||||||||
Get the message size.
| |||||||||||
Get the decoded subject.
| |||||||||||
Invalidate cached header and envelope information for this
message.
| |||||||||||
Test if the given Flags are set in this message.
| |||||||||||
Remove all headers with this name.
| |||||||||||
Set the "Content-ID" header field of this Message.
| |||||||||||
Set the "Content-Language" header of this MimePart.
| |||||||||||
Set the "Content-MD5" header field of this Message.
| |||||||||||
This method provides the mechanism to set this part's content.
| |||||||||||
Set the "Content-Description" header field for this Message.
| |||||||||||
Set the "Content-Disposition" header field of this Message.
| |||||||||||
Set the filename associated with this part, if possible.
| |||||||||||
Set/Unset the given flags in this message.
| |||||||||||
Set the RFC 822 "From" header field.
| |||||||||||
Set the value for this header_name.
| |||||||||||
Set whether or not to use the PEEK variant of FETCH when
fetching message content.
| |||||||||||
Set the specified recipient type to the given addresses.
| |||||||||||
Set the RFC 822 "Reply-To" header field.
| |||||||||||
Set the RFC 822 "Sender" header field.
| |||||||||||
Set the RFC 822 "Date" header field.
| |||||||||||
Set the "Subject" header field.
| |||||||||||
Write out the bytes into the given outputstream.
| |||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Do a NOOP to force any untagged EXPUNGE responses
and then check if this message is expunged.
| |||||||||||
Get all the bytes for this message.
| |||||||||||
Get the messageCacheLock, associated with this Message's
GmailFolder.
| |||||||||||
Get this message's folder's protocol connection.
| |||||||||||
Get this message's IMAP sequence number.
| |||||||||||
Sets the expunged flag for this Message.
| |||||||||||
Wrapper around the protected method Message.setMessageNumber() to
make that method accessible to IMAPFolder.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.code.javax.mail.internet.MimeMessage
| |||||||||||
From class
com.google.code.javax.mail.Message
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.google.code.javax.mail.HasRawInputStream
| |||||||||||
From interface
com.google.code.javax.mail.Part
| |||||||||||
From interface
com.google.code.javax.mail.internet.MimePart
| |||||||||||
Constructor, for use by IMAPNestedMessage.
| session |
|---|
| x_gm_labels |
|---|
Add the specified addresses to the existing "From" field. If the "From" field does not already exist, it is created.
| addresses | The senders of this message |
|---|
| MessagingException |
|---|
Add 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.
| name | Header name |
|---|---|
| value | Header value |
| MessagingException |
|---|
Add the given addresses to the specified recipient type.
| type | Recipient type |
|---|---|
| addresses | Addresses |
| MessagingException |
|---|
Get the Content-Type. Generate this header from the BODYSTRUCTURE. Append parameters as well.
| MessagingException |
|---|
Get the DataHandler object for this message.
| MessagingException |
|---|
Get the Content-Disposition.
| MessagingException |
|---|
Get the "filename" Disposition parameter. (Only available in IMAP4rev1). If thats not available, get the "name" ContentType parameter.
| MessagingException |
|---|
Get the Flags for this message.
| MessagingException |
|---|
Get the named header.
| name | Name of header |
|---|
| MessagingException |
|---|
Get the named header.
| name | The name of this header |
|---|---|
| delimiter | Separator between values |
| MessagingException |
|---|
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
| MessagingException |
|---|
Get matching headers.
| names |
|---|
| MessagingException |
|---|
Get non-matching headers.
| names |
|---|
| MessagingException |
|---|
Get whether or not to use the PEEK variant of FETCH when fetching message content.
Get the recieved date (INTERNALDATE)
| MessagingException |
|---|
Get the desired Recipient type.
| type | Type of recepient |
|---|
| MessagingException |
|---|
Get the ReplyTo addresses.
| MessagingException |
|---|
Get the message size.
Note that this returns RFC822.SIZE. That is, it's the size of the whole message, header and body included.
| MessagingException |
|---|
Invalidate cached header and envelope information for this message. Subsequent accesses of this information will cause it to be fetched from the server.
Test if the given Flags are set in this message.
| flag | The flag |
|---|
| MessagingException |
|---|
Remove all headers with this name.
| name | The name of this header |
|---|
| MessagingException |
|---|
Set the "Content-ID" header field of this Message.
If the cid parameter is null, any existing
"Content-ID" is removed.
| cid |
|---|
| MessagingException |
|---|
Set the "Content-Language" header of this MimePart. The Content-Language header is defined by RFC 1766.
| languages | Array of language tags |
|---|
| MessagingException |
|---|
Set the "Content-MD5" header field of this Message.
| md5 | The MD5 value |
|---|
| MessagingException |
|---|
This method provides the mechanism to set this part's content. The given DataHandler object should wrap the actual content.
| content | The DataHandler for the content. |
|---|
| MessagingException |
|---|
Set the "Content-Description" header field for this Message.
If the description parameter is null, 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.
| description | Description |
|---|---|
| charset | Charset for encoding |
| MessagingException |
|---|
Set the "Content-Disposition" header field of this Message.
If disposition is null, any existing "Content-Disposition"
header field is removed.
| disposition | Disposition of this part |
|---|
| MessagingException |
|---|
Set 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.encodefilename System property
is set to true, the MimeUtility.encodeText method 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.
| filename | Filename to associate with this part |
|---|
| MessagingException |
|---|
Set/Unset the given flags in this message.
| flag | Flags object containing the flags to be set |
|---|---|
| set | The value to be set |
| MessagingException |
|---|
Set the RFC 822 "From" header field. Any existing values are
replaced with the given address. If address is null,
this header is removed.
| address | The sender of this message |
|---|
| MessagingException |
|---|
| x_gm_msgid |
|---|
| x_gm_thrid |
|---|
Set 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.
| name | Header name |
|---|---|
| value | Header value |
| MessagingException |
|---|
Set whether or not to use the PEEK variant of FETCH when fetching message content.
| peek |
|---|
Set the specified recipient type to the given addresses.
If the address parameter is null, the corresponding
recipient field is removed.
| type | Recipient type |
|---|---|
| addresses | Addresses |
| MessagingException |
|---|
Set the RFC 822 "Reply-To" header field. If the address
parameter is null, this header is removed.
| addresses | Addresses to which replies should be directed |
|---|
| MessagingException |
|---|
Set the RFC 822 "Sender" header field. Any existing values are
replaced with the given address. If address is null,
this header is removed.
| address | The sender of this message |
|---|
| MessagingException |
|---|
Set 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 is
null, the existing "Date" field is removed.
| d | The sent date of this message |
|---|
| MessagingException |
|---|
Set 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.
| subject | The subject |
|---|---|
| charset | The charset |
| MessagingException |
|---|
Write out the bytes into the given outputstream.
| os |
|---|
| IOException | |
|---|---|
| MessagingException |
Do a NOOP to force any untagged EXPUNGE responses and then check if this message is expunged.
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.
| MessagingException |
|---|
Get the messageCacheLock, associated with this Message's GmailFolder.
Get this message's folder's protocol connection. Throws FolderClosedException, if the protocol connection is not available. ASSERT: Must hold the messageCacheLock.
Get this message's IMAP sequence number. ASSERT: This method must be called only when holding the messageCacheLock.
Sets the expunged flag for this Message. This method is to be used only by the implementation classes.
| set | The expunged flag |
|---|
Wrapper around the protected method Message.setMessageNumber() to make that method accessible to IMAPFolder.
| msgnum |
|---|
| uid |
|---|