public class MimeMessageParser extends Object
| Constructor and Description |
|---|
MimeMessageParser(javax.mail.internet.MimeMessage message)
Constructs an instance with the MimeMessage to be extracted.
|
| Modifier and Type | Method and Description |
|---|---|
protected DataSource |
createDataSource(javax.mail.internet.MimePart part)
Parses the MimePart to create a DataSource.
|
Map<String,DataSource> |
getAttachmentList() |
List<javax.mail.internet.InternetAddress> |
getBcc() |
List<javax.mail.internet.InternetAddress> |
getCc() |
Map<String,DataSource> |
getCidMap() |
protected String |
getDataSourceName(javax.mail.Part part,
DataSource dataSource)
Determines the name of the data source if it is not already set.
|
javax.mail.internet.InternetAddress |
getFrom() |
Map<String,Object> |
getHeaders() |
String |
getHtmlContent() |
String |
getPlainContent() |
javax.mail.internet.InternetAddress |
getReplyTo() |
String |
getSubject() |
List<javax.mail.internet.InternetAddress> |
getTo() |
MimeMessageParser |
parse()
Does the actual extraction.
|
protected void |
parse(javax.mail.internet.MimePart part)
Extracts the content of a MimeMessage recursively.
|
public MimeMessageParser(javax.mail.internet.MimeMessage message)
message - the message to parsepublic MimeMessageParser parse() throws javax.mail.MessagingException, IOException
javax.mail.MessagingExceptionIOExceptionpublic List<javax.mail.internet.InternetAddress> getTo() throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic List<javax.mail.internet.InternetAddress> getCc() throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic List<javax.mail.internet.InternetAddress> getBcc() throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic javax.mail.internet.InternetAddress getFrom()
throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic javax.mail.internet.InternetAddress getReplyTo()
throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic String getSubject() throws javax.mail.MessagingException
javax.mail.MessagingExceptionprotected void parse(javax.mail.internet.MimePart part)
throws javax.mail.MessagingException,
IOException
part - the current MimePartjavax.mail.MessagingException - parsing the MimeMessage failedIOException - parsing the MimeMessage failedprotected DataSource createDataSource(javax.mail.internet.MimePart part) throws javax.mail.MessagingException, IOException
part - the current part to be processedjavax.mail.MessagingException - creating the DataSource failedIOException - creating the DataSource failedprotected String getDataSourceName(javax.mail.Part part, DataSource dataSource) throws javax.mail.MessagingException, UnsupportedEncodingException
part - the mail partdataSource - the data sourcenull if no name can be determinedjavax.mail.MessagingException - accessing the part failedUnsupportedEncodingException - decoding the text failedpublic Map<String,DataSource> getCidMap()
cidMappublic String getPlainContent()
plainContentpublic Map<String,DataSource> getAttachmentList()
attachmentListpublic String getHtmlContent()
htmlContentCopyright © 2016. All rights reserved.