public class ContentUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static ContentType |
ANY_MULTIPART_TYPE
ContentType object representing the "multipart/*" MIME type.
|
static ContentType |
ANY_TEXT_TYPE
ContentType object representing the "text/*" MIME type.
|
static String |
CHARSET_PARAMETER |
static String |
NAME_PARAMETER |
static ContentType |
TEXT_PLAIN_TYPE |
| Constructor and Description |
|---|
ContentUtil() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
getBytes(BodyPart p)
Get binary (byte array) content from the provided BodyPart.
|
static byte[] |
getBytes(DataHandler dh)
Get binary (byte array) content from the provided DataHandler.
|
static Object |
getContent(BodyPart p)
Get content object from a BodyPart.
|
static Object |
getContent(DataHandler dh,
String contentType)
Get content object from a DataHandler.
|
static String |
getString(BodyPart p)
Get String content from the provided BodyPart.
|
static String |
getString(DataHandler dh)
Get String content from the provided DataHandler.
|
public static ContentType ANY_MULTIPART_TYPE
public static ContentType ANY_TEXT_TYPE
public static ContentType TEXT_PLAIN_TYPE
public static final String NAME_PARAMETER
public static final String CHARSET_PARAMETER
public static String getString(BodyPart p) throws MessagingException, IOException
p - MessagingExceptionIOExceptionpublic static String getString(DataHandler dh) throws MessagingException, IOException
dh - MessagingExceptionIOExceptionpublic static byte[] getBytes(BodyPart p) throws MessagingException, IOException
p - MessagingExceptionIOExceptionpublic static byte[] getBytes(DataHandler dh) throws MessagingException, IOException
dh - MessagingExceptionIOExceptionpublic static Object getContent(BodyPart p) throws MessagingException, IOException
p - MessagingExceptionIOExceptionpublic static Object getContent(DataHandler dh, String contentType) throws MessagingException, IOException
dh - contentType - MessagingExceptionIOExceptionCopyright © 2009,2013 Oracle and/or its affiliates. All rights reserved.