public class ContentAwareComposedMailMessage extends ComposedMailMessage implements ContentAware
COLOR_LABEL_NONE, COLOR_LABEL_PREFIX, COLOR_LABEL_PREFIX_OLD, FLAG_ANSWERED, FLAG_DELETED, FLAG_DRAFT, FLAG_FLAGGED, FLAG_FORWARDED, FLAG_READ_ACK, FLAG_RECENT, FLAG_SEEN, FLAG_SPAM, FLAG_USER, PRIORITY_HIGH, PRIORITY_HIGHEST, PRIORITY_LOW, PRIORITY_LOWEST, PRIORITY_NORMAL, USER_FORWARDED, USER_READ_ACKNO_ENCLOSED_PARTS| Constructor and Description |
|---|
ContentAwareComposedMailMessage(javax.mail.internet.MimeMessage content,
com.openexchange.session.Session session,
com.openexchange.groupware.contexts.Context ctx)
Initializes a new
ContentAwareComposedMailMessage. |
| Modifier and Type | Method and Description |
|---|---|
void |
addEnclosedPart(MailPart part)
Adds an instance of
MailPart to enclosed parts |
boolean |
containsFrom() |
TextBodyMailPart |
getBodyPart()
Gets this composed message's body part.
|
java.lang.Object |
getContent()
Returns the part's content as a Java object dependent on underlying implementation.
|
javax.activation.DataHandler |
getDataHandler()
Returns an appropriate
DataHandler for this mail part. |
int |
getEnclosedCount()
Gets the number of enclosed mail parts.
|
MailPart |
getEnclosedMailPart(int index)
Gets this composed mail's part located at given index.
|
java.lang.String |
getFirstHeader(java.lang.String name)
Gets the first header for specified header name.
|
javax.mail.internet.InternetAddress[] |
getFrom() |
java.io.InputStream |
getInputStream()
Returns an input stream for this part.
|
java.lang.String |
getMailId()
Gets the implementation-specific unique ID of this mail in its mail folder.
|
void |
loadContent()
Ensures that the part's content is loaded, thus this part is independent of the original.
|
void |
prepareForCaching()
Prepares this mail part to be put into cache; meaning to release all kept resources
|
MailPart |
removeEnclosedPart(int index)
Removes the enclosed part at the specified position.
|
void |
setBodyPart(TextBodyMailPart mailPart)
Sets this composed message's body part.
|
void |
setMailId(java.lang.String id)
Sets the implementation-specific unique mail ID of this mail in its mail folder.
|
addRecipient, addRecipients, cleanUp, getContext, getRecipients, getSendType, getSession, getUnreadMessages, hasRecipients, setFiller, setSendType, setUnreadMessagesaddBcc, addBcc, addCc, addCc, addFrom, addFrom, addTo, addTo, addUserFlag, addUserFlags, clone, containsAccountId, containsAccountName, containsAppendVCard, containsBcc, containsCc, containsColorLabel, containsDispositionNotification, containsFlags, containsFolder, containsHasAttachment, containsMessageId, containsPrevSeen, containsPriority, containsReceivedDate, containsRecentCount, containsReferences, containsSentDate, containsSubject, containsThreadLevel, containsTo, containsUserFlags, getAccountId, getAccountName, getBcc, getCc, getColorLabel, getColorLabelIntValue, getColorLabelStringValue, getDispositionNotification, getFlags, getFolder, getInReplyTo, getMailPath, getMessageId, getPriority, getReceivedDate, getReceivedDateDirect, getRecentCount, getReferences, getSentDate, getSubject, getThreadLevel, getTo, getUserFlags, hasAttachment, isAnswered, isAppendVCard, isColorLabel, isDeleted, isDraft, isFlagged, isForwarded, isPrevSeen, isReadAcknowledgment, isRecent, isSeen, isSpam, isUser, parseColorLabel, removeAccountId, removeAccountName, removeAppendVCard, removeBcc, removeCc, removeColorLabel, removeDispositionNotification, removeFlags, removeFolder, removeFrom, removeHasAttachment, removeMessageId, removePrevSeen, removePriority, removeReceivedDate, removeRecentCount, removeReferences, removeSentDate, removeSubject, removeThreadLevel, removeTo, removeUserFlags, setAccountId, setAccountName, setAppendVCard, setColorLabel, setDispositionNotification, setFlag, setFlags, setFolder, setHasAttachment, setMessageId, setPrevSeen, setPriority, setReceivedDate, setRecentCount, setReferences, setReferences, setSentDate, setSubject, setThreadLeveladdHeader, addHeaders, containsContentDisposition, containsContentId, containsContentType, containsFileName, containsHeader, containsHeaders, containsMsgref, containsSequenceId, containsSize, getContentDisposition, getContentId, getContentType, getFileName, getHeader, getHeader, getHeader, getHeaders, getHeadersIterator, getHeadersSize, getMatchingHeaders, getMsgref, getNonMatchingHeaders, getSequenceId, getSize, getSource, getSourceBytes, hasEnclosedParts, hasHeaders, removeContentDisposition, removeContentId, removeContentType, removeFileName, removeHeader, removeHeaders, removeMsgref, removeSequenceId, removeSize, setContentDisposition, setContentDisposition, setContentId, setContentType, setContentType, setFileName, setHeader, setMsgref, setSequenceId, setSize, writeTopublic ContentAwareComposedMailMessage(javax.mail.internet.MimeMessage content,
com.openexchange.session.Session session,
com.openexchange.groupware.contexts.Context ctx)
ContentAwareComposedMailMessage.content - The content objectsession - The sessionctx - The contextpublic boolean containsFrom()
containsFrom in class MailMessagetrue if From is set; otherwise falsepublic javax.mail.internet.InternetAddress[] getFrom()
getFrom in class MailMessagepublic java.lang.String getFirstHeader(java.lang.String name)
MailPart
This is a convenience method that invokes MailPart.getHeader(String, String) with the latter parameter set to null.
getFirstHeader in class MailPartname - The header namenullpublic java.lang.Object getContent()
throws com.openexchange.exception.OXException
MailPartmultipart/*getContent in class MailPartnull if not applicablecom.openexchange.exception.OXException - If content cannot be returned as a Java objectpublic int getEnclosedCount()
throws com.openexchange.exception.OXException
ComposedMailMessage
Note: The returned number does not include the text body part applied with ComposedMailMessage.setBodyPart(TextBodyMailPart). To check
for contained parts:
composedMail.getEnclosedCount() > 0
getEnclosedCount in class ComposedMailMessageMailPart.NO_ENCLOSED_PARTS if not applicablecom.openexchange.exception.OXExceptionMailPart.NO_ENCLOSED_PARTSpublic MailPart getEnclosedMailPart(int index) throws com.openexchange.exception.OXException
ComposedMailMessage
Note: This method does not include the text body part applied with ComposedMailMessage.setBodyPart(TextBodyMailPart).
getEnclosedMailPart in class ComposedMailMessageindex - The index of desired mail part or null if not applicablecom.openexchange.exception.OXExceptionpublic void setBodyPart(TextBodyMailPart mailPart)
ComposedMailMessageThe body part's content is supposed to be HTML content which is ought to be converted to appropriate MIME type on transport.
setBodyPart in class ComposedMailMessagemailPart - The body partpublic TextBodyMailPart getBodyPart()
ComposedMailMessageThe body part's content is supposed to be HTML content which is ought to be converted to appropriate MIME type on transport.
getBodyPart in class ComposedMailMessagepublic MailPart removeEnclosedPart(int index)
ComposedMailMessageremoveEnclosedPart in class ComposedMailMessageindex - The index positionpublic void addEnclosedPart(MailPart part)
ComposedMailMessageMailPart to enclosed partsaddEnclosedPart in class ComposedMailMessagepart - The instance of MailPart to addpublic java.lang.String getMailId()
MailMessagegetMailId in class MailMessagenull if not available.public void setMailId(java.lang.String id)
MailMessagesetMailId in class MailMessageid - The mail ID or null to indicate its absencepublic javax.activation.DataHandler getDataHandler()
throws com.openexchange.exception.OXException
MailPartDataHandler for this mail part. multipart/*getDataHandler in class MailPartDataHandler or null if not applicablecom.openexchange.exception.OXException - If an appropriate DataHandler cannot be returnedpublic java.io.InputStream getInputStream()
throws com.openexchange.exception.OXException
MailPartmultipart/*getInputStream in class MailPartnull if not applicablecom.openexchange.exception.OXException - If no input stream could be returnedpublic void loadContent()
throws com.openexchange.exception.OXException
MailPartThis method is intended for mailing systems that read the contents stepwise on demand. If dealing with such a mail part with its underlying connection closed, the part's content is no more accessible. Otherwise this method may be implemented with an empty body.
Moreover the loaded content is no more discarded when MailPart.prepareForCaching() is invoked.
loadContent in class MailPartcom.openexchange.exception.OXException - If loading part's content failspublic void prepareForCaching()
MailPartprepareForCaching in class MailPart