|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opencrx.application.mail.importer.SimpleMimeMessage
public class SimpleMimeMessage
Helper class to provide a more simple access to the regularly used attributes of a mime message for importing emails.
| Field Summary | |
|---|---|
static String |
DISPOSITION_INLINE
|
static String |
OPENCRX_MESSAGE_ID
|
static String |
OPENCRX_MESSAGE_IDENTITY
|
static short |
PRIORITY_HIGH
|
static short |
PRIORITY_IMMEDIATE
|
static short |
PRIORITY_LOW
|
static short |
PRIORITY_NORMAL
|
static short |
PRIORITY_URGENT
|
static String |
UNSPECIFIED_ADDRESS
|
| Constructor Summary | |
|---|---|
SimpleMimeMessage(javax.mail.internet.MimeMessage theMessage)
Constructor |
|
SimpleMimeMessage(javax.mail.internet.MimeMessage theMessage,
boolean initAttributes)
Constructor If initAttributes is true, the attributes are initialized
immediately by parsing the underlying MimeMessage. |
|
| Method Summary | |
|---|---|
boolean |
containsAttachments()
Checks whether the message contains binary attachments. |
boolean |
containsNestedMessage()
Checks whether the message contains binary attachments. |
String |
getAllHeaderLinesAsString()
Extracts the complete content of all header elements of a MIME message and returns them as concatenated string using the system's line separator as separator between the elements. |
Collection |
getBinaryContents()
Returns a collection of the binary attachments or null if the message does not contain any. |
String |
getBody()
Extracts the body part of a MIME message, currently only message bodies of the following formats are supported: String InputStream MultiPart In case of MultiParts only parts of the mime types "text/plain" and "text/html" are currently supported. |
Collection |
getContents()
Returns a collection of the attachments or null if the message does not contain any. |
Date |
getDate()
Extracts date of the message it was sent and cache it locally. |
String[] |
getFrom()
Extracts the sender's email address from the message and cache it locally. |
String[] |
getHeader(String name)
Get all the headers for this header_name. |
String |
getMessageID()
Extracts the message ID of the message and cache it locally |
String |
getMessageIdentity()
|
short |
getPriority()
Extract the priority from the email message. |
String[] |
getRecipients()
Extracts the recipients of type Message.RecipientType.TO ("To") of the message and cache it locally. |
String[] |
getRecipients(javax.mail.Message.RecipientType type)
Extracts the recipients of the given type of the message and cache it locally. |
String |
getSubject()
Extracts the subject of the message and cache it locally. |
Collection |
getTextContents()
Returns a collection of the text attachments or null if the message does not contain any. |
boolean |
hasIdentity()
Checks whether the message contains an openCRX identity. |
void |
markAsDeleted()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String OPENCRX_MESSAGE_ID
public static final String OPENCRX_MESSAGE_IDENTITY
public static final String UNSPECIFIED_ADDRESS
public static final String DISPOSITION_INLINE
public static final short PRIORITY_LOW
public static final short PRIORITY_NORMAL
public static final short PRIORITY_HIGH
public static final short PRIORITY_URGENT
public static final short PRIORITY_IMMEDIATE
| Constructor Detail |
|---|
public SimpleMimeMessage(javax.mail.internet.MimeMessage theMessage)
throws javax.mail.MessagingException,
IOException
theMessage - the MimeMessage which has to be wrapped
javax.mail.MessagingException
IOException
public SimpleMimeMessage(javax.mail.internet.MimeMessage theMessage,
boolean initAttributes)
throws javax.mail.MessagingException,
IOException
initAttributes is true, the attributes are initialized
immediately by parsing the underlying MimeMessage. Therefore although
the folder containing the MimeMessage may already be closed, this
instance already holds the derived values for the attributes.
theMessage - the MimeMessage which has to be wrappedinitAttributes - true if the attributes should be initialized immediately, false otherwise
javax.mail.MessagingException
IOException| Method Detail |
|---|
public String[] getHeader(String name)
throws javax.mail.MessagingException
This implementation obtains the headers from the headers
InternetHeaders object.
name - name of header
javax.mail.MessagingExceptionMimeMessage
public String getAllHeaderLinesAsString()
throws javax.mail.MessagingException
javax.mail.MessagingException
public String getBody()
throws javax.mail.MessagingException,
IOException
javax.mail.MessagingException
IOException
public String getMessageIdentity()
throws javax.mail.MessagingException
javax.mail.MessagingException
public String getMessageID()
throws javax.mail.MessagingException
javax.mail.MessagingException
public String getSubject()
throws javax.mail.MessagingException
javax.mail.MessagingException
public Date getDate()
throws javax.mail.MessagingException
javax.mail.MessagingException
public String[] getFrom()
throws javax.mail.internet.AddressException,
javax.mail.MessagingException
UNSPECIFIED_ADDRESS is used.
javax.mail.internet.AddressException
javax.mail.MessagingException
public String[] getRecipients()
throws javax.mail.MessagingException
javax.mail.MessagingException
public String[] getRecipients(javax.mail.Message.RecipientType type)
throws javax.mail.MessagingException
type - the type for which the addresses are needed, i.e. either
"To", "Cc" or "Bcc"
javax.mail.MessagingException
public short getPriority()
throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic boolean containsAttachments()
public boolean containsNestedMessage()
public boolean hasIdentity()
public Collection getContents()
public Collection getTextContents()
public Collection getBinaryContents()
public String toString()
toString in class Objectpublic void markAsDeleted()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||