public class ReceivedEmail extends CommonEmail<ReceivedEmail>
Modifier and Type | Field and Description |
---|---|
static ReceivedEmail[] |
EMPTY_ARRAY |
PRIORITY_HIGH, PRIORITY_HIGHEST, PRIORITY_LOW, PRIORITY_LOWEST, PRIORITY_NORMAL, X_PRIORITY
Constructor and Description |
---|
ReceivedEmail(javax.mail.Message msg,
boolean envelope,
java.io.File attachmentStorage)
Creates a
ReceivedEmail from a given Message . |
Modifier and Type | Method and Description |
---|---|
ReceivedEmail |
attachedMessage(ReceivedEmail email)
Adds attached
ReceivedEmail . |
java.util.List<ReceivedEmail> |
attachedMessages()
Returns the
List of attached messages. |
ReceivedEmail |
attachedMessages(java.util.List<ReceivedEmail> emails)
Adds attached
ReceivedEmail s. |
ReceivedEmail |
clone()
Clones the email with all its necessary data.
|
static ReceivedEmail |
create()
Static constructor for fluent interface.
|
javax.mail.Flags |
flags() |
ReceivedEmail |
flags(javax.mail.Flags flags)
Sets the flags.
|
boolean |
isAnswered()
Returns
true if message is answered. |
boolean |
isDeleted()
Returns
true if message is deleted. |
boolean |
isDraft()
Returns
true if message is draft. |
boolean |
isFlagged()
Returns
true is message is flagged. |
boolean |
isRecent()
Returns
true if message is recent. |
boolean |
isSeen()
Returns
true if message is seen. |
java.lang.String |
messageId()
Returns message ID if set by server.
|
ReceivedEmail |
messageId(java.lang.String messageId)
Sets message ID.
|
int |
messageNumber()
Returns message number.
|
ReceivedEmail |
messageNumber(int messageNumber)
Sets message number.
|
javax.mail.Message |
originalMessage() |
ReceivedEmail |
originalMessage(javax.mail.Message originalMessage)
Sets the original message.
|
protected static java.lang.String |
parseContentId(javax.mail.Part part)
Returns the Content-ID of this
Part . |
protected static boolean |
parseInline(javax.mail.Part part)
Returns
true if the Part is inline. |
protected void |
parseMessage(javax.mail.Message msg,
boolean envelope)
Parses
Message and extracts all data for the received message. |
protected void |
processPart(javax.mail.Part part)
Process part of the received message.
|
java.util.Date |
receivedDate()
Returns email's received
Date . |
ReceivedEmail |
receivedDate(java.util.Date date)
Sets email's received
Date . |
_this, attachment, attachment, attachments, attachments, cc, cc, cc, cc, cc, cc, cc, cc, embeddedAttachment, embeddedAttachment, from, from, from, from, from, header, header, headers, headers, headers, htmlMessage, htmlMessage, message, message, message, message, messages, priority, priority, replyTo, replyTo, replyTo, replyTo, replyTo, replyTo, replyTo, replyTo, resetCc, resetReplyTo, resetTo, sentDate, sentDate, storeAttachment, storeAttachments, subject, subject, subject, subjectEncoding, textMessage, textMessage, to, to, to, to, to, to, to, to, toString, valueOrEmptyArray
public static final ReceivedEmail[] EMPTY_ARRAY
public ReceivedEmail(javax.mail.Message msg, boolean envelope, java.io.File attachmentStorage)
ReceivedEmail
from a given Message
.msg
- Message
envelope
- flag if this is an envelopepublic static ReceivedEmail create()
ReceivedEmail
.public ReceivedEmail clone()
CommonEmail
clone
in class CommonEmail<ReceivedEmail>
protected void parseMessage(javax.mail.Message msg, boolean envelope) throws javax.mail.MessagingException, java.io.IOException
Message
and extracts all data for the received message.msg
- Message
to parse.java.io.IOException
- if there is an error with the contentjavax.mail.MessagingException
- if there is an error.protected void processPart(javax.mail.Part part) throws javax.mail.MessagingException, java.io.IOException
ReceivedEmail
,
i.e. hierarchy is not saved.part
- Part
of received messagejava.io.IOException
- if there is an error with the content.javax.mail.MessagingException
- if there is an error.protected static java.lang.String parseContentId(javax.mail.Part part) throws javax.mail.MessagingException
Part
. Returns null
if none present.part
- Part
the Part to parse.javax.mail.MessagingException
- if there is a failure.MimePart.getContentID()
protected static boolean parseInline(javax.mail.Part part) throws javax.mail.MessagingException
true
if the Part
is inline.part
- Part
to parse.true
if the Part
is inline.javax.mail.MessagingException
- if there is a failure.public javax.mail.Message originalMessage()
Message
public ReceivedEmail originalMessage(javax.mail.Message originalMessage)
originalMessage
- Message
to set.public javax.mail.Flags flags()
Flags
public ReceivedEmail flags(javax.mail.Flags flags)
flags
- Flags
to set.public boolean isAnswered()
true
if message is answered.true
if message is answered.public boolean isDeleted()
true
if message is deleted.true
if message is deleted.public boolean isDraft()
true
if message is draft.public boolean isFlagged()
true
is message is flagged.true
is message is flagged.public boolean isRecent()
true
if message is recent.true
if message is recent.public boolean isSeen()
true
if message is seen.true
if message is seen.public int messageNumber()
public java.lang.String messageId()
public ReceivedEmail messageNumber(int messageNumber)
messageNumber
- The message number to set.public ReceivedEmail messageId(java.lang.String messageId)
public ReceivedEmail receivedDate(java.util.Date date)
Date
.date
- The received Date
to set.public java.util.Date receivedDate()
Date
.Date
.public ReceivedEmail attachedMessages(java.util.List<ReceivedEmail> emails)
ReceivedEmail
s.emails
- List
of ReceivedEmail
s to attach.public ReceivedEmail attachedMessage(ReceivedEmail email)
ReceivedEmail
.email
- ReceivedEmail
to attach.public java.util.List<ReceivedEmail> attachedMessages()
List
of attached messages.
If no attached message is available, returns an empty List
.List
of ReceivedEmail
s.Copyright © 2003-present Jodd Team