public abstract class MailMessage extends MailPart
| Modifier and Type | Field and Description |
|---|---|
static int |
COLOR_LABEL_NONE
The
int value for no color label |
static java.lang.String |
COLOR_LABEL_PREFIX
The prefix for a mail message's color labels stored as a user flag
|
static java.lang.String |
COLOR_LABEL_PREFIX_OLD
The deprecated prefix for a mail message's color labels stored as a user flag
|
static int |
FLAG_ANSWERED
This message has been answered.
|
static int |
FLAG_DELETED
This message is marked deleted.
|
static int |
FLAG_DRAFT
This message is a draft.
|
static int |
FLAG_FLAGGED
This message is flagged.
|
static int |
FLAG_FORWARDED
Virtual forwarded flag that marks this message as being forwarded.
|
static int |
FLAG_READ_ACK
Virtual read acknowledgment flag that marks this message as being notified for delivery.
|
static int |
FLAG_RECENT
This message is recent.
|
static int |
FLAG_SEEN
This message is seen.
|
static int |
FLAG_SPAM
Virtual Spam flag
|
static int |
FLAG_USER
A special flag that indicates that this folder supports user defined flags.
|
static int |
PRIORITY_HIGH
High priority
|
static int |
PRIORITY_HIGHEST
Highest priority
|
static int |
PRIORITY_LOW
Low priority
|
static int |
PRIORITY_LOWEST
Lowest priority
|
static int |
PRIORITY_NORMAL
Normal priority
|
static java.lang.String |
USER_FORWARDED
The value of virtual forwarded flag.
|
static java.lang.String |
USER_READ_ACK
The value of virtual read acknowledgment flag.
|
NO_ENCLOSED_PARTS| Modifier and Type | Method and Description |
|---|---|
void |
addBcc(javax.mail.internet.InternetAddress addr)
Adds an email address to Bcc
|
void |
addBcc(javax.mail.internet.InternetAddress[] addrs)
Adds email addresses to Bcc
|
void |
addCc(javax.mail.internet.InternetAddress addr)
Adds an email address to Cc
|
void |
addCc(javax.mail.internet.InternetAddress[] addrs)
Adds email addresses to Cc
|
void |
addFrom(javax.mail.internet.InternetAddress addr)
Adds an email address to From.
|
void |
addFrom(javax.mail.internet.InternetAddress[] addrs)
Adds email addresses to From.
|
void |
addTo(javax.mail.internet.InternetAddress addr)
Adds an email address to To.
|
void |
addTo(javax.mail.internet.InternetAddress[] addrs)
Adds email addresses to To
|
void |
addUserFlag(java.lang.String userFlag)
Adds given user flag
|
void |
addUserFlags(java.lang.String[] userFlags)
Adds given user flags
|
java.lang.Object |
clone() |
boolean |
containsAccountId() |
boolean |
containsAccountName() |
boolean |
containsAppendVCard() |
boolean |
containsBcc() |
boolean |
containsCc() |
boolean |
containsColorLabel() |
boolean |
containsDispositionNotification() |
boolean |
containsFlags() |
boolean |
containsFolder() |
boolean |
containsFrom() |
boolean |
containsHasAttachment() |
boolean |
containsMessageId() |
boolean |
containsPrevSeen() |
boolean |
containsPriority() |
boolean |
containsReceivedDate() |
boolean |
containsRecentCount() |
boolean |
containsReferences() |
boolean |
containsSentDate() |
boolean |
containsSubject() |
boolean |
containsThreadLevel() |
boolean |
containsTo() |
boolean |
containsUserFlags() |
int |
getAccountId()
Gets the account ID.
|
java.lang.String |
getAccountName()
Gets the account Name
|
javax.mail.internet.InternetAddress[] |
getBcc() |
javax.mail.internet.InternetAddress[] |
getCc() |
int |
getColorLabel()
Gets the color label
|
static int |
getColorLabelIntValue(java.lang.String cl)
Determines the corresponding
int value of a given color label's string representation. |
static java.lang.String |
getColorLabelStringValue(int cl)
Generates the color label's string representation from given
int value. |
javax.mail.internet.InternetAddress |
getDispositionNotification()
Gets the dispositionNotification
|
int |
getFlags()
Gets the flags
|
java.lang.String |
getFolder()
Gets the folder
|
javax.mail.internet.InternetAddress[] |
getFrom() |
java.lang.String |
getInReplyTo()
Gets the In-Reply-To value.
|
abstract java.lang.String |
getMailId()
Gets the implementation-specific unique ID of this mail in its mail folder.
|
MailPath |
getMailPath()
Gets the mail path.
|
java.lang.String |
getMessageId()
Gets the Message-Id value.
|
int |
getPriority()
Gets the priority
|
java.util.Date |
getReceivedDate()
Gets the received date which represents the internal timestamp set by mail server on arrival.
|
java.util.Date |
getReceivedDateDirect()
Gets the received date directly which represents the internal timestamp set by mail server on arrival.
|
int |
getRecentCount()
Gets the number of recent mails in associated folder.
|
java.lang.String[] |
getReferences()
Gets the References.
|
java.util.Date |
getSentDate()
Gets the sent date which corresponds to Date header
|
java.lang.String |
getSubject()
Gets the subject
|
int |
getThreadLevel()
Gets the threadLevel
|
javax.mail.internet.InternetAddress[] |
getTo() |
abstract int |
getUnreadMessages()
Gets the number of unread messages
|
java.lang.String[] |
getUserFlags()
Gets the user flags
|
boolean |
hasAttachment()
Gets the hasAttachment
|
boolean |
isAnswered() |
boolean |
isAppendVCard()
Gets the appendVCard
|
static boolean |
isColorLabel(java.lang.String cl)
Tests if specified string matches a color label pattern.
|
boolean |
isDeleted() |
boolean |
isDraft() |
boolean |
isFlagged() |
boolean |
isForwarded() |
boolean |
isPrevSeen()
Gets the previous \Seen state.
|
boolean |
isReadAcknowledgment() |
boolean |
isRecent() |
boolean |
isSeen() |
boolean |
isSpam() |
boolean |
isUser() |
static int |
parseColorLabel(java.lang.String cl,
int defaultValue)
Parses specified color label's string.
|
void |
removeAccountId()
Removes the account ID.
|
void |
removeAccountName()
Removes the account name.
|
void |
removeAppendVCard()
Removes the appendVCard
|
void |
removeBcc()
Removes the Bcc addresses
|
void |
removeCc()
Removes the Cc addresses
|
void |
removeColorLabel()
Removes the color label
|
void |
removeDispositionNotification()
Removes the dispositionNotification
|
void |
removeFlags()
Removes the flags
|
void |
removeFolder()
Removes the folder
|
void |
removeFrom()
Removes the From addresses.
|
void |
removeHasAttachment()
Removes the hasAttachment
|
void |
removeMessageId()
Removes the Message-Id.
|
void |
removePrevSeen()
Removes the previous \Seen state
|
void |
removePriority()
Removes the priority
|
void |
removeReceivedDate()
Removes the received date
|
void |
removeRecentCount()
Removes the recent count.
|
void |
removeReferences()
Removes the References.
|
void |
removeSentDate()
Removes the sent date
|
void |
removeSubject()
Removes the subject
|
void |
removeThreadLevel()
Removes the threadLevel
|
void |
removeTo()
Removes the To addresses
|
void |
removeUserFlags()
Removes the userFlags
|
void |
setAccountId(int accountId)
Sets the account ID.
|
void |
setAccountName(java.lang.String accountName)
Sets the account Name
|
void |
setAppendVCard(boolean appendVCard)
Sets the appendVCard
|
void |
setColorLabel(int colorLabel)
Sets the color label
|
void |
setDispositionNotification(javax.mail.internet.InternetAddress dispositionNotification)
Sets the dispositionNotification
|
void |
setFlag(int flag,
boolean enable)
Sets a system flag
|
void |
setFlags(int flags)
Sets the flags
|
void |
setFolder(java.lang.String folder)
Sets the folder
|
void |
setHasAttachment(boolean hasAttachment)
Sets the hasAttachment
|
abstract void |
setMailId(java.lang.String id)
Sets the implementation-specific unique mail ID of this mail in its mail folder.
|
void |
setMessageId(java.lang.String messageId)
Sets the Message-Id.
|
void |
setPrevSeen(boolean prevSeen)
Sets the previous \Seen state.
|
void |
setPriority(int priority)
Sets the priority
|
void |
setReceivedDate(java.util.Date receivedDate)
Sets the received date
|
void |
setRecentCount(int recentCount)
Sets the number of recent mails in associated folder.
|
void |
setReferences(java.lang.String sReferences)
Sets the References.
|
void |
setReferences(java.lang.String[] references)
Sets the References.
|
void |
setSentDate(java.util.Date sentDate)
Sets the sent date
|
void |
setSubject(java.lang.String subject)
Sets the subject
|
void |
setThreadLevel(int threadLevel)
Sets the threadLevel
|
abstract void |
setUnreadMessages(int unreadMessages)
Sets the number of unread messages
|
addHeader, addHeaders, containsContentDisposition, containsContentId, containsContentType, containsFileName, containsHeader, containsHeaders, containsMsgref, containsSequenceId, containsSize, getContent, getContentDisposition, getContentId, getContentType, getDataHandler, getEnclosedCount, getEnclosedMailPart, getFileName, getFirstHeader, getHeader, getHeader, getHeader, getHeaders, getHeadersIterator, getHeadersSize, getInputStream, getMatchingHeaders, getMsgref, getNonMatchingHeaders, getSequenceId, getSize, getSource, getSourceBytes, hasEnclosedParts, hasHeaders, loadContent, prepareForCaching, removeContentDisposition, removeContentId, removeContentType, removeFileName, removeHeader, removeHeaders, removeMsgref, removeSequenceId, removeSize, setContentDisposition, setContentDisposition, setContentId, setContentType, setContentType, setFileName, setHeader, setMsgref, setSequenceId, setSize, writeTopublic static final int FLAG_ANSWERED
public static final int FLAG_DELETED
public static final int FLAG_DRAFT
public static final int FLAG_FLAGGED
public static final int FLAG_RECENT
Clients cannot alter this flag.
public static final int FLAG_SEEN
public static final int FLAG_USER
Clients cannot alter this flag.
public static final int FLAG_SPAM
public static final int FLAG_FORWARDED
public static final int FLAG_READ_ACK
public static final java.lang.String USER_FORWARDED
public static final java.lang.String USER_READ_ACK
public static final int PRIORITY_HIGHEST
public static final int PRIORITY_HIGH
public static final int PRIORITY_NORMAL
public static final int PRIORITY_LOW
public static final int PRIORITY_LOWEST
public static final java.lang.String COLOR_LABEL_PREFIX
public static final java.lang.String COLOR_LABEL_PREFIX_OLD
public static final int COLOR_LABEL_NONE
int value for no color labelpublic static int getColorLabelIntValue(java.lang.String cl)
throws com.openexchange.exception.OXException
int value of a given color label's string representation.
A color label's string representation matches the pattern:
<value-of-COLOR_LABEL_PREFIX><color-label-int-value>
<value-of-COLOR_LABEL_PREFIX_OLD ><color-label-int-value> is also accepted.
cl - The color label's string representationint valuecom.openexchange.exception.OXExceptionpublic static boolean isColorLabel(java.lang.String cl)
cl - The string to checktrue if specified string matches a color label pattern; otherwise falsepublic static int parseColorLabel(java.lang.String cl,
int defaultValue)
Note that this method assumes isColorLabel(String) would return true for specified string.
cl - The color label's stringdefaultValue - The default value to return if parsing color label's int value failsint value or defaultValue on failure.public static java.lang.String getColorLabelStringValue(int cl)
int value.
A color label's string representation matches the pattern:
<value-of-COLOR_LABEL_PREFIX><color-label-int-value>
cl - The color label's int valuepublic void addFrom(javax.mail.internet.InternetAddress addr)
addr - The addresspublic void addFrom(javax.mail.internet.InternetAddress[] addrs)
addrs - The addressespublic boolean containsFrom()
true if From is set; otherwise falsepublic void removeFrom()
public javax.mail.internet.InternetAddress[] getFrom()
public void addTo(javax.mail.internet.InternetAddress addr)
addr - The addresspublic void addTo(javax.mail.internet.InternetAddress[] addrs)
addrs - The addressespublic boolean containsTo()
true if To is set; otherwise falsepublic void removeTo()
public javax.mail.internet.InternetAddress[] getTo()
public void addCc(javax.mail.internet.InternetAddress addr)
addr - The addresspublic void addCc(javax.mail.internet.InternetAddress[] addrs)
addrs - The addressespublic boolean containsCc()
true if Cc is set; otherwise falsepublic void removeCc()
public javax.mail.internet.InternetAddress[] getCc()
public void addBcc(javax.mail.internet.InternetAddress addr)
addr - The addresspublic void addBcc(javax.mail.internet.InternetAddress[] addrs)
addrs - The addressespublic boolean containsBcc()
true if Bcc is set; otherwise falsepublic void removeBcc()
public javax.mail.internet.InternetAddress[] getBcc()
public int getFlags()
public boolean isAnswered()
true if flag \ANSWERED is set; otherwise falsepublic boolean isDeleted()
true if flag \DELETED is set; otherwise falsepublic boolean isDraft()
true if flag \DRAFT is set; otherwise falsepublic boolean isFlagged()
true if flag \FLAGGED is set; otherwise falsepublic boolean isRecent()
true if flag \RECENT is set; otherwise falsepublic boolean isSeen()
true if flag \SEEN is set; otherwise falsepublic boolean isSpam()
true if virtual spam flag is set; otherwise falsepublic boolean isForwarded()
true if forwarded flag is set; otherwise falsepublic boolean isReadAcknowledgment()
true if read acknowledgment flag is set; otherwise falsepublic boolean isUser()
true if flag \USER is set; otherwise falsepublic boolean containsFlags()
true if flags is set; otherwise falsepublic void removeFlags()
public void setFlags(int flags)
flags - the flags to setpublic void setFlag(int flag,
boolean enable)
throws com.openexchange.exception.OXException
flag - The system flag to setenable - true to enable; otherwise falsecom.openexchange.exception.OXException - If an illegal flag argument is specifiedpublic boolean isPrevSeen()
This flag is used when writing the message later on. There a check is performed whether header
Disposition-Notification-To is indicated or not.
public boolean containsPrevSeen()
true if previous \Seen state is set; otherwise falsepublic void removePrevSeen()
public void setPrevSeen(boolean prevSeen)
This flag is used when writing the message later on. There a check is performed whether header
Disposition-Notification-To is indicated or not.
prevSeen - the previous \Seen state to setpublic int getThreadLevel()
public boolean containsThreadLevel()
true if threadLevel is set; otherwise falsepublic void removeThreadLevel()
public void setThreadLevel(int threadLevel)
threadLevel - the threadLevel to setpublic java.lang.String getSubject()
public boolean containsSubject()
true if subject is set; otherwise falsepublic void removeSubject()
public void setSubject(java.lang.String subject)
subject - the subject to setpublic java.util.Date getSentDate()
public boolean containsSentDate()
true if sent date is set; otherwise falsepublic void removeSentDate()
public void setSentDate(java.util.Date sentDate)
sentDate - the sent date to setpublic java.util.Date getReceivedDate()
public java.util.Date getReceivedDateDirect()
public boolean containsReceivedDate()
true if received date is set; otherwise falsepublic void removeReceivedDate()
public void setReceivedDate(java.util.Date receivedDate)
receivedDate - the received date to setpublic void addUserFlag(java.lang.String userFlag)
userFlag - The user flag to addpublic void addUserFlags(java.lang.String[] userFlags)
userFlags - The user flags to addpublic boolean containsUserFlags()
true if userFlags is set; otherwise falsepublic void removeUserFlags()
public java.lang.String[] getUserFlags()
public int getColorLabel()
public boolean containsColorLabel()
true if color label is set; otherwise falsepublic void removeColorLabel()
public void setColorLabel(int colorLabel)
colorLabel - the color label to setpublic int getPriority()
public boolean containsPriority()
true if priority is set; otherwise falsepublic void removePriority()
public void setPriority(int priority)
priority - the priority to setpublic javax.mail.internet.InternetAddress getDispositionNotification()
public boolean containsDispositionNotification()
true if dispositionNotification is set; otherwise falsepublic void removeDispositionNotification()
public void setDispositionNotification(javax.mail.internet.InternetAddress dispositionNotification)
dispositionNotification - the dispositionNotification to setpublic java.lang.String getFolder()
public boolean containsFolder()
true if folder is set; otherwise falsepublic void removeFolder()
public void setFolder(java.lang.String folder)
folder - the folder to setpublic int getAccountId()
public boolean containsAccountId()
true if account ID is set; otherwise falsepublic void removeAccountId()
public void setAccountId(int accountId)
accountId - The account IDpublic java.lang.String getAccountName()
public boolean containsAccountName()
true if account name is set; otherwise falsepublic void removeAccountName()
public void setAccountName(java.lang.String accountName)
accountName - The account namepublic boolean hasAttachment()
public boolean containsHasAttachment()
true if hasAttachment is set; otherwise falsepublic void removeHasAttachment()
public void setHasAttachment(boolean hasAttachment)
hasAttachment - the hasAttachment to setpublic boolean isAppendVCard()
public boolean containsAppendVCard()
true if appendVCard is set; otherwise falsepublic void removeAppendVCard()
public void setAppendVCard(boolean appendVCard)
appendVCard - the appendVCard to setpublic int getRecentCount()
public boolean containsRecentCount()
true if number of recent mails is set; otherwise falsepublic void removeRecentCount()
public void setRecentCount(int recentCount)
recentCount - The recent countpublic MailPath getMailPath()
accountId - The account IDpublic java.lang.String getMessageId()
nullpublic boolean containsMessageId()
true if Message-Id is set; otherwise falsepublic void removeMessageId()
public void setMessageId(java.lang.String messageId)
sReferences - The Message-Id header valuepublic java.lang.String getInReplyTo()
nullpublic java.lang.String[] getReferences()
nullpublic boolean containsReferences()
true if References is set; otherwise falsepublic void removeReferences()
public void setReferences(java.lang.String sReferences)
sReferences - The References header valuepublic void setReferences(java.lang.String[] references)
references - The Referencespublic abstract java.lang.String getMailId()
null if not available.public abstract void setMailId(java.lang.String id)
id - The mail ID or null to indicate its absencepublic abstract int getUnreadMessages()
public abstract void setUnreadMessages(int unreadMessages)
unreadMessages - The number of unread messages