public class EmailUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
ATTR_CHARSET |
Constructor and Description |
---|
EmailUtil() |
Modifier and Type | Method and Description |
---|---|
static ReceiveMailSession |
createSession(java.lang.String protocol,
java.util.Properties sessionProperties,
javax.mail.Authenticator authenticator,
java.io.File attachmentStorage) |
static java.lang.String |
extractEncoding(java.lang.String contentType)
Extracts encoding from a given content type.
|
static java.lang.String |
extractEncoding(java.lang.String contentType,
java.lang.String defaultEncoding)
Extracts encoding from a given content type.
|
static java.lang.String |
extractMimeType(java.lang.String contentType)
Extracts MIME type from content type.
|
static boolean |
isEmptyFlags(javax.mail.Flags flags)
Check whether flags is a empty flags
|
static java.lang.String |
resolveFileName(javax.mail.Part part)
Correctly resolves file name from the message part.
|
protected static final java.lang.String ATTR_CHARSET
public static java.lang.String extractMimeType(java.lang.String contentType)
contentType
- MIME type.public static java.lang.String extractEncoding(java.lang.String contentType)
contentType
- content type.null
if encoding is not specified in content type.public static java.lang.String extractEncoding(java.lang.String contentType, java.lang.String defaultEncoding)
contentType
- content type.defaultEncoding
- Default encoding to be used if extract returns null
.
If defaultEncoding is null
, JoddCore.encoding
will be used.extractEncoding(String)
public static java.lang.String resolveFileName(javax.mail.Part part) throws javax.mail.MessagingException
part
- Part
to decode file name from.javax.mail.MessagingException
public static ReceiveMailSession createSession(java.lang.String protocol, java.util.Properties sessionProperties, javax.mail.Authenticator authenticator, java.io.File attachmentStorage)
protocol
- Protocol such as ImapServer.PROTOCOL_IMAP
or Pop3Server.PROTOCOL_POP3
.sessionProperties
- Session properties to use.authenticator
- Authenticator which contains necessary authentication for server.ReceiveMailSession
.public static boolean isEmptyFlags(javax.mail.Flags flags)
flags
- a flags of message to checkCopyright © 2003-present Jodd Team