/** * Creates new {@link ByteArrayDataSource} and then calls {@link #content(DataSource)}. * * @param bytes array of bytes * @param contentType content type from {@link EmailAttachment}. * @return this * @see #content(DataSource) */ public EmailAttachmentBuilder content(final byte[] bytes, final String contentType) { return content(new ByteArrayDataSource(bytes, resolveContentType(contentType))); }
/** * Creates new {@link ByteArrayDataSource} and then calls {@link #content(DataSource)}. * * @param inputStream {@link InputStream} * @param contentType content type from {@link EmailAttachment}. * @return this * @throws IOException if {@link ByteArrayDataSource} cannot be created from {@link InputStream} * @see #content(DataSource) */ public EmailAttachmentBuilder content(final InputStream inputStream, final String contentType) throws IOException { return content(new ByteArrayDataSource(inputStream, resolveContentType(contentType))); }
/** * Creates new {@link ByteArrayDataSource} and then calls {@link #content(DataSource)}. * * @param bytes array of bytes * @param contentType content type from {@link EmailAttachment}. * @return this * @see #content(DataSource) */ public EmailAttachmentBuilder content(final byte[] bytes, final String contentType) { return content(new ByteArrayDataSource(bytes, resolveContentType(contentType))); }
/** * Creates new {@link ByteArrayDataSource} and then calls {@link #content(DataSource)}. * * @param inputStream {@link InputStream} * @param contentType content type from {@link EmailAttachment}. * @return this * @throws IOException if {@link ByteArrayDataSource} cannot be created from {@link InputStream} * @see #content(DataSource) */ public EmailAttachmentBuilder content(final InputStream inputStream, final String contentType) throws IOException { return content(new ByteArrayDataSource(inputStream, resolveContentType(contentType))); }