public class Attachment
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static Attachment |
fromByteArray(java.lang.String name,
java.lang.String contentType,
byte[] data)
Create an attachment based on the contents of the byte array.
|
static Attachment |
fromFile(java.lang.String contentType,
java.io.File file)
Create an attachment based on the contents of a file.
|
static Attachment |
fromInputStream(java.lang.String name,
java.lang.String contentType,
java.io.InputStream in)
Create an attachment based on the contents read from an input stream.
|
static Attachment |
fromResource(java.lang.ClassLoader cl,
java.lang.String contentType,
java.lang.String resource)
Create an attachment based on the contents of a resource in the classpath.
|
static Attachment |
fromResource(java.lang.String contentType,
java.lang.String resource)
Create an attachment based on the contents of a resource in the classpath.
|
java.lang.String |
toString() |
public static Attachment fromFile(java.lang.String contentType, java.io.File file) throws java.io.IOException
java.io.IOExceptionpublic static Attachment fromResource(java.lang.String contentType, java.lang.String resource) throws java.io.IOException
java.io.IOExceptionpublic static Attachment fromResource(java.lang.ClassLoader cl, java.lang.String contentType, java.lang.String resource) throws java.io.IOException
java.io.IOExceptionpublic static Attachment fromInputStream(java.lang.String name, java.lang.String contentType, java.io.InputStream in) throws java.io.IOException
java.io.IOExceptionpublic static Attachment fromByteArray(java.lang.String name, java.lang.String contentType, byte[] data)
public java.lang.String toString()
toString in class java.lang.Object