Package com.netflix.iep.ses
Class Attachment
java.lang.Object
com.netflix.iep.ses.Attachment
Attachment data to add into the email. Keep in mind that there are
restrictions
on the type of files that are allowed as attachments. There are also
limits on
the overall size of a message.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AttachmentfromByteArray(String name, String contentType, byte[] data) Create an attachment based on the contents of the byte array.static AttachmentCreate an attachment based on the contents of a file.static AttachmentfromInputStream(String name, String contentType, InputStream in) Create an attachment based on the contents read from an input stream.static AttachmentfromResource(ClassLoader cl, String contentType, String resource) Create an attachment based on the contents of a resource in the classpath.static AttachmentfromResource(String contentType, String resource) Create an attachment based on the contents of a resource in the classpath.toString()
-
Method Details
-
fromFile
Create an attachment based on the contents of a file.- Throws:
IOException
-
fromResource
Create an attachment based on the contents of a resource in the classpath. This method will use the context class loader of the current thread.- Throws:
IOException
-
fromResource
public static Attachment fromResource(ClassLoader cl, String contentType, String resource) throws IOException Create an attachment based on the contents of a resource in the classpath.- Throws:
IOException
-
fromInputStream
public static Attachment fromInputStream(String name, String contentType, InputStream in) throws IOException Create an attachment based on the contents read from an input stream.- Throws:
IOException
-
fromByteArray
Create an attachment based on the contents of the byte array. -
toString
-