|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object com.auxilii.msgparser.Message
public class Message
Class that represents a .msg file. Some
fields from the .msg file are stored in special
parameters (e.g., fromEmail
).
Attachments are stored in the property
attachments
). An attachment may be
of the type MsgAttachment
which
represents another attached (encapsulated)
.msg object.
Field Summary | |
---|---|
protected List<Attachment> |
attachments
A list of all attachments (both FileAttachment
and MsgAttachment ). |
protected String |
bodyHTML
The body in HTML format (if available) |
protected String |
bodyRTF
The body in RTF format (if available) |
protected String |
bodyText
The normalized body text. |
protected Date |
clientSubmitTime
Client Submit Time |
protected String |
convertedBodyHTML
The body in HTML format (converted from RTF) |
protected Date |
creationDate
|
protected Date |
date
Email Date |
protected String |
displayBcc
The displayed Bcc: field |
protected String |
displayCc
The displayed Cc: field |
protected String |
displayTo
The displayed To: field |
protected String |
fromEmail
The address part of From: mail address. |
protected String |
fromName
The name part of the From: mail address |
protected String |
headers
Email headers (if available) |
protected Date |
lastModificationDate
|
protected static Logger |
logger
|
protected String |
messageClass
The message class as defined in the .msg file. |
protected String |
messageId
The message Id. |
protected Map<Integer,Object> |
properties
Contains all properties that are not covered by the special properties. |
protected List<RecipientEntry> |
recipients
A list containing all recipients for this message (which can be set in the 'to:', 'cc:' and 'bcc:' field, respectively). |
protected RTF2HTMLConverter |
rtf2htmlConverter
|
protected String |
subject
The mail's subject. |
protected String |
toEmail
The address part of To: mail address. |
protected String |
toName
The name part of the To: mail address |
Constructor Summary | |
---|---|
Message()
|
|
Message(RTF2HTMLConverter rtf2htmlConverter)
|
Method Summary | |
---|---|
void |
addAttachment(Attachment attachment)
|
void |
addRecipient(RecipientEntry recipient)
|
protected void |
checkToRecipient()
Checks if the correct recipient's addresses are set. |
String |
convertToHex(Integer propCode)
Converts a given integer to hex notation without leading '0x'. |
protected String |
convertValueToString(Object value)
|
String |
createMailString(String mail,
String name)
Convenience method for creating an email address expression (including the name, the address, or both). |
protected byte[] |
decompressRtfBytes(byte[] value)
Decompresses compressed RTF data. |
List<Attachment> |
getAttachments()
|
List<RecipientEntry> |
getBccRecipients()
Retrieves a list of RecipientEntry objects that represent the BCC recipients of the message. |
String |
getBodyHTML()
|
String |
getBodyRTF()
|
String |
getBodyText()
|
List<RecipientEntry> |
getCcRecipients()
Retrieves a list of RecipientEntry objects that represent the CC recipients of the message. |
Date |
getClientSubmitTime()
|
String |
getConvertedBodyHTML()
|
Date |
getCreationDate()
|
Date |
getDate()
|
static Date |
getDateFromHeaders(String headers)
Parses the message date from the mail headers. |
String |
getDisplayBcc()
|
String |
getDisplayCc()
|
String |
getDisplayTo()
|
String |
getFromEmail()
|
protected static String |
getFromEmailFromHeaders(String headers)
Parses the sender's email address from the mail headers. |
String |
getFromName()
|
String |
getHeaders()
|
Date |
getLastModificationDate()
|
String |
getMessageClass()
|
String |
getMessageId()
|
Set<String> |
getProperties()
Deprecated. |
Set<String> |
getPropertiesAsHex()
This method provides a convenient way of retrieving property keys for all guys that like to stick to hex values. |
Object |
getProperty(String name)
Deprecated. |
Set<Integer> |
getPropertyCodes()
This method returns a list of all available properties. |
Object |
getPropertyFromHex(String name)
This method provides a convenient way of retrieving properties for all guys that like to stick to hex values. |
String |
getPropertyListing()
Generates a string that can be used to debug the properties of the msg. |
Object |
getPropertyValue(Integer code)
This method retrieves the value for a specific property. |
List<RecipientEntry> |
getRecipients()
|
String |
getSubject()
|
String |
getToEmail()
|
String |
getToName()
|
RecipientEntry |
getToRecipient()
Retrieves the RecipientEntry object that represents the TO recipient of the message. |
protected static Date |
parseDateString(String date)
|
void |
setAttachments(List<Attachment> attachments)
|
void |
setBodyHTML(String bodyHTML)
|
protected void |
setBodyHTML(String bodyToSet,
boolean force)
|
void |
setBodyRTF(Object bodyRTF)
|
void |
setBodyText(String bodyText)
|
void |
setClientSubmitTime(String value)
|
void |
setConvertedBodyHTML(String convertedBodyHTML)
|
void |
setCreationDate(String value)
|
void |
setDate(Date date)
|
void |
setDisplayBcc(String displayBcc)
|
void |
setDisplayCc(String displayCc)
|
void |
setDisplayTo(String displayTo)
|
void |
setFromEmail(String fromEmail)
|
void |
setFromEmail(String fromEmail,
boolean force)
|
void |
setFromName(String fromName)
|
void |
setHeaders(String headers)
|
void |
setLastModificationDate(String value)
|
void |
setMessageClass(String messageClass)
|
void |
setMessageId(String messageId)
|
void |
setProperty(MessageProperty msgProp)
Sets the name/value pair in the properties
map. |
void |
setRecipients(List<RecipientEntry> recipients)
|
void |
setSubject(String subject)
|
void |
setToEmail(String toEmail)
|
void |
setToEmail(String toEmail,
boolean force)
|
void |
setToName(String toName)
|
String |
toLongString()
Provides all information of this message object. |
String |
toString()
Provides a short representation of this .msg object. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final Logger logger
protected String messageClass
protected String messageId
protected String fromEmail
protected String fromName
protected String toEmail
protected String toName
protected String subject
protected String bodyText
protected String displayTo
protected String displayCc
protected String displayBcc
protected String bodyRTF
protected String bodyHTML
protected String convertedBodyHTML
protected String headers
protected Date date
protected Date clientSubmitTime
protected Date creationDate
protected Date lastModificationDate
protected List<Attachment> attachments
FileAttachment
and MsgAttachment
).
protected Map<Integer,Object> properties
protected List<RecipientEntry> recipients
protected RTF2HTMLConverter rtf2htmlConverter
Constructor Detail |
---|
public Message()
public Message(RTF2HTMLConverter rtf2htmlConverter)
Method Detail |
---|
public void addAttachment(Attachment attachment)
public void addRecipient(RecipientEntry recipient)
public void setProperty(MessageProperty msgProp) throws ClassCastException
properties
map. Some properties are put into
special attributes (e.g., toEmail
when
the property name is '0076').
name
- The property name (i.e., the class
of the document entry).value
- The value of the field.
ClassCastException
- Thrown if the detected data
type does not match the expected data type.protected String convertValueToString(Object value)
protected void checkToRecipient()
protected static Date parseDateString(String date)
date
- The date string to be converted (e.g.: 'Mon Jul 23 15:43:12 CEST 2012')
Date
object representing the given date string.protected byte[] decompressRtfBytes(byte[] value)
value
- Data to be decompressed.
public String toString()
toString
in class Object
Object.toString()
public String toLongString()
public String createMailString(String mail, String name)
mail
- The mail address.name
- The name part of the address.
public List<Attachment> getAttachments()
public void setAttachments(List<Attachment> attachments)
attachments
- the attachments to setpublic List<RecipientEntry> getRecipients()
public void setRecipients(List<RecipientEntry> recipients)
recipients
- the recipients to setpublic String getFromEmail()
public void setFromEmail(String fromEmail)
fromEmail
- the fromEmail to setpublic void setFromEmail(String fromEmail, boolean force)
fromEmail
- the fromEmail to setforce
- forces overwriting of the field if already setpublic String getFromName()
public void setFromName(String fromName)
fromName
- the fromName to setpublic String getDisplayTo()
public void setDisplayTo(String displayTo)
public String getDisplayCc()
public void setDisplayCc(String displayCc)
public String getDisplayBcc()
public void setDisplayBcc(String displayBcc)
public String getMessageClass()
public void setMessageClass(String messageClass)
messageClass
- the messageClass to setpublic String getMessageId()
public void setMessageId(String messageId)
messageId
- the messageId to setpublic String getSubject()
public void setSubject(String subject)
subject
- the subject to setpublic String getToEmail()
public void setToEmail(String toEmail)
toEmail
- the toEmail to setpublic void setToEmail(String toEmail, boolean force)
toEmail
- the toEmail to setforce
- forces overwriting of the field if already setpublic String getToName()
public void setToName(String toName)
toName
- the toName to setpublic RecipientEntry getToRecipient()
RecipientEntry
object that represents the TO recipient of the message.
RecipientEntry
was found.public List<RecipientEntry> getCcRecipients()
RecipientEntry
objects that represent the CC recipients of the message.
public List<RecipientEntry> getBccRecipients()
RecipientEntry
objects that represent the BCC recipients of the message.
public String getBodyText()
public void setBodyText(String bodyText)
bodyText
- the bodyText to setpublic String getBodyRTF()
public void setBodyRTF(Object bodyRTF)
bodyRTF
- the bodyRTF to setpublic String getBodyHTML()
public void setBodyHTML(String bodyHTML)
bodyHTML
- the bodyHTML to setpublic String getConvertedBodyHTML()
public void setConvertedBodyHTML(String convertedBodyHTML)
convertedBodyHTML
- the bodyHTML to setprotected void setBodyHTML(String bodyToSet, boolean force)
bodyHTML
- the bodyHTML to setforce
- forces overwriting of the field if already setpublic String getHeaders()
public void setHeaders(String headers)
headers
- the headers to setprotected static String getFromEmailFromHeaders(String headers)
The
- headers in a single String object
public static Date getDateFromHeaders(String headers)
headers
- The headers in a single String object
public Date getDate()
public void setDate(Date date)
date
- the date to setpublic Date getClientSubmitTime()
public void setClientSubmitTime(String value)
public Date getCreationDate()
public void setCreationDate(String value)
public Date getLastModificationDate()
public void setLastModificationDate(String value)
@Deprecated public Set<String> getProperties()
public Set<String> getPropertiesAsHex()
getPropertyCodes()
.
@Deprecated public Object getProperty(String name)
getPropertyCodes()
for dealing with integer based keys.
public Object getPropertyFromHex(String name)
getPropertyValue(Integer)
.
name
- The hex notation of the property to be retrieved.
public Set<Integer> getPropertyCodes()
public Object getPropertyValue(Integer code)
getPropertyValue(Integer)
for dealing with integer based keys. MAPIProp
to easily read certain properties.
code
- The key for the property to be retrieved.
public String getPropertyListing()
public String convertToHex(Integer propCode)
propCode
- The value to be formatted.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |