|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openexchange.mail.dataobjects.MailPart
com.openexchange.mail.dataobjects.MailMessage
com.openexchange.mail.mime.dataobjects.MIMEMailMessage
public final class MIMEMailMessage
MIMEMailMessage - A subclass of MailMessage to support MIME messages (as per RFC822).
| Field Summary |
|---|
| Fields inherited from class com.openexchange.mail.dataobjects.MailMessage |
|---|
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_ACK |
| Fields inherited from class com.openexchange.mail.dataobjects.MailPart |
|---|
NO_ENCLOSED_PARTS |
| Constructor Summary | |
|---|---|
MIMEMailMessage()
Constructor - Constructs an empty mail message |
|
MIMEMailMessage(javax.mail.internet.MimeMessage msg)
Constructor - Only applies specified message, but does not set any attributes |
|
| Method Summary | |
|---|---|
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 the mail part located at given index. |
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. |
javax.mail.internet.MimeMessage |
getMimeMessage()
Gets the MIME message. |
char |
getSeparator()
Gets the separator. |
int |
getSeqnum()
Gets the sequence number. |
int |
getUnreadMessages()
Gets the number of unread messages |
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 |
void |
setContent(javax.mail.internet.MimeMessage msg)
Sets this mail message's content Through providing a null reference the body is cleared from this mail. |
void |
setMailId(java.lang.String id)
Sets the implementation-specific unique mail ID of this mail in its mail folder. |
void |
setSeparator(char separator)
Sets the separator. |
void |
setSeqnum(int seqnum)
Sets the sequence number. |
void |
setUnreadMessages(int unreadMessages)
Sets the number of unread messages |
void |
writeTo(java.io.OutputStream out)
Writes complete part's data into given output stream |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MIMEMailMessage()
public MIMEMailMessage(javax.mail.internet.MimeMessage msg)
| Method Detail |
|---|
public char getSeparator()
public void setSeparator(char separator)
separator - The separator to setpublic int getSeqnum()
public void setSeqnum(int seqnum)
seqnum - The sequence number to setpublic void setContent(javax.mail.internet.MimeMessage msg)
Through providing a null reference the body is cleared from this mail.
msg - The MIME message or null to clear any body referencespublic javax.mail.internet.MimeMessage getMimeMessage()
MIME message.
MIME message or nullpublic java.lang.String getMailId()
MailMessage
Note If ID is numeric, max. 52 bits may be used in returned value which implies a max. allowed value of
4503599627370495.
getMailId in class MailMessagenull if not available.public void setMailId(java.lang.String id)
MailMessage
Note If ID is numeric, max. 52 bits may be used in specified value which implies a max. allowed value of
4503599627370495.
setMailId in class MailMessageid - The mail ID or null to indicate its absence
public java.lang.Object getContent()
throws MailException
MailPartmultipart/*
getContent in class MailPartnull if not applicable
MailException - If content cannot be returned as a Java object
public javax.activation.DataHandler getDataHandler()
throws MailException
MailPartDataHandler for this mail part. multipart/*
getDataHandler in class MailPartDataHandler or null if not applicable
MailException - If an appropriate DataHandler cannot be returned
public int getEnclosedCount()
throws MailException
MailPartmultipart/*
getEnclosedCount in class MailPartMailPart.NO_ENCLOSED_PARTS if not applicable
MailExceptionMailPart.NO_ENCLOSED_PARTS
public MailPart getEnclosedMailPart(int index)
throws MailException
MailPartmultipart/*
getEnclosedMailPart in class MailPartindex - The index of desired mail part or null if not applicable
MailException
public java.io.InputStream getInputStream()
throws MailException
MailPartmultipart/*
getInputStream in class MailPartnull if not applicable
MailException - If no input stream could be returned
public void writeTo(java.io.OutputStream out)
throws MailException
MailPart
writeTo in class MailPartout - The output stream to write to
MailException - If writing to output stream fails
public void loadContent()
throws MailException
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 MailPartMailException - If loading part's content failspublic void prepareForCaching()
MailPart
prepareForCaching in class MailPartpublic void setUnreadMessages(int unreadMessages)
MailMessage
setUnreadMessages in class MailMessageunreadMessages - The number of unread messagespublic int getUnreadMessages()
MailMessage
getUnreadMessages in class MailMessage
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||