public final class AttachmentUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BODY_ATTACHMENT_ID |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
cleanContentId(java.lang.String id) |
static Attachment |
createAttachment(java.io.InputStream stream,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers) |
static java.lang.String |
createContentID(java.lang.String ns) |
static Attachment |
createMtomAttachment(boolean isXop,
java.lang.String mimeType,
java.lang.String elementNS,
byte[] data,
int offset,
int length,
int threshold) |
static Attachment |
createMtomAttachmentFromDH(boolean isXop,
javax.activation.DataHandler handler,
java.lang.String elementNS,
int threshold) |
static java.io.InputStream |
decode(java.io.InputStream in,
java.lang.String encoding) |
static javax.activation.DataSource |
getAttachmentDataSource(java.lang.String contentId,
java.util.Collection<Attachment> atts) |
static java.lang.String |
getAttachmentPartHeader(Attachment att) |
static javax.activation.CommandMap |
getCommandMap() |
static java.util.Map<java.lang.String,javax.activation.DataHandler> |
getDHMap(java.util.Collection<Attachment> attachments) |
static java.lang.String |
getUniqueBoundaryValue() |
static boolean |
isMtomEnabled(Message message) |
static boolean |
isTypeSupported(java.lang.String contentType,
java.util.List<java.lang.String> types) |
static void |
setStreamedAttachmentProperties(Message message,
CachedOutputStream bos) |
public static final java.lang.String BODY_ATTACHMENT_ID
public static javax.activation.CommandMap getCommandMap()
public static boolean isMtomEnabled(Message message)
public static void setStreamedAttachmentProperties(Message message, CachedOutputStream bos) throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String createContentID(java.lang.String ns)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingExceptionpublic static java.lang.String getUniqueBoundaryValue()
public static java.lang.String getAttachmentPartHeader(Attachment att)
public static java.util.Map<java.lang.String,javax.activation.DataHandler> getDHMap(java.util.Collection<Attachment> attachments)
public static java.lang.String cleanContentId(java.lang.String id)
public static Attachment createAttachment(java.io.InputStream stream, java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers) throws java.io.IOException
java.io.IOExceptionpublic static java.io.InputStream decode(java.io.InputStream in,
java.lang.String encoding)
throws java.io.IOException
java.io.IOExceptionpublic static boolean isTypeSupported(java.lang.String contentType,
java.util.List<java.lang.String> types)
public static Attachment createMtomAttachment(boolean isXop, java.lang.String mimeType, java.lang.String elementNS, byte[] data, int offset, int length, int threshold)
public static Attachment createMtomAttachmentFromDH(boolean isXop, javax.activation.DataHandler handler, java.lang.String elementNS, int threshold)
public static javax.activation.DataSource getAttachmentDataSource(java.lang.String contentId,
java.util.Collection<Attachment> atts)