public class EMLParser
extends java.lang.Object
Constructor and Description |
---|
EMLParser() |
Modifier and Type | Method and Description |
---|---|
protected T |
_this() |
static EMLParser |
create() |
protected javax.mail.Session |
createSession(java.util.Properties properties)
Creates new
Session with or without custom Properties . |
protected java.util.Properties |
getProperties()
Returns the
Properties . |
protected javax.mail.Session |
getSession()
Returns the
Session . |
ReceivedEmail |
parse(byte[] content)
Parses EML with provided EML content.
|
ReceivedEmail |
parse(java.io.File emlFile)
Starts EML parsing with provided EML
File . |
protected ReceivedEmail |
parse(java.io.InputStream emlContentInputStream)
Parses the EML content.
|
ReceivedEmail |
parse(java.lang.String emlContent)
Parses EML with provided EML content.
|
ReceivedEmail |
parse(java.lang.String emlContent,
java.lang.String charset)
Parses EML with provided EML content.
|
T |
set(java.util.Properties properties)
Copies properties from given set.
|
T |
set(java.lang.String name,
java.lang.String value)
Sets property for the
Session . |
T |
useDefaultSession()
Uses default
Session . |
public static EMLParser create()
public ReceivedEmail parse(java.lang.String emlContent, java.lang.String charset) throws java.io.UnsupportedEncodingException, javax.mail.MessagingException
emlContent
- String
with EML content.charset
- String with charset.ReceivedEmail
.java.io.UnsupportedEncodingException
- if the named charset is not supported.javax.mail.MessagingException
- if MimeMessage
cannot be created.parse(byte[])
public ReceivedEmail parse(java.lang.String emlContent) throws javax.mail.MessagingException
emlContent
- String
with EML content.ReceivedEmail
.javax.mail.MessagingException
- if MimeMessage
cannot be created.parse(String, String)
public ReceivedEmail parse(byte[] content) throws javax.mail.MessagingException
content
- byte[] with EML content.ReceivedEmail
.javax.mail.MessagingException
- if MimeMessage
cannot be created.parse(InputStream)
public ReceivedEmail parse(java.io.File emlFile) throws java.io.FileNotFoundException, javax.mail.MessagingException
File
.emlFile
- File
with EML content.ReceivedEmail
.java.io.FileNotFoundException
- if emlFile cannot be foundjavax.mail.MessagingException
- if MimeMessage
cannot be created.parse(InputStream)
protected ReceivedEmail parse(java.io.InputStream emlContentInputStream) throws javax.mail.MessagingException
Session
is not created, default one will be used.emlContentInputStream
- InputStream
containing the EML content.ReceivedEmail
.javax.mail.MessagingException
- if MimeMessage
cannot be created.protected T _this()
protected javax.mail.Session getSession()
Session
.Session
.protected java.util.Properties getProperties()
Properties
.Properties
.protected javax.mail.Session createSession(java.util.Properties properties)
Session
with or without custom Properties
.properties
- Custom properties to be used during Session
creation. It is acceptable is this value is null
.Session
with any custom Properties
public T set(java.util.Properties properties) throws MailException
Session
is already created, exception will be thrown.properties
- Properties
to set.MailException
- if the Properties
has already been set.public T set(java.lang.String name, java.lang.String value)
Session
. If Session
is already created, an exception
will be thrown.name
- Property name to set.value
- Property value to set.MailException
- if the Properties
has already been set.public T useDefaultSession()
Session
. Any property will be ignored.System.getProperties()
Copyright © 2003-present Jodd Team