public interface EmailMessageBinaryAttachmentBuilder
JavaMailSessionBuilderFactory.INSTANCE| Modifier and Type | Method and Description |
|---|---|
EmailMessageBinaryAttachmentBuilder |
attachBinaryData(byte[] byteArr,
IsEmptyAllowed isEmptyAllowed)
Adds new attachment to the parent builder.
|
EmailMessageBinaryAttachmentBuilder |
attachBinaryFile(File filePath,
IsEmptyAllowed isEmptyAllowed)
Immediately reads the contents of the file as binary data, then adds new attachment to the parent builder.
|
EmailMessageBinaryAttachmentBuilder |
attachBinaryInputStream(InputStream inputStream,
IsEmptyAllowed isEmptyAllowed)
Immediately reads the contents of the
InputStream as binary data,
then adds new attachment to the parent builder. |
EmailMessageBinaryAttachmentBuilder |
attachmentFileName(String attachmentFileName)
This is the most common attachment type.
|
EmailMessageBinaryAttachmentBuilder |
attachMessage(javax.mail.Message message)
Converts a MIME message to binary data, then adds new attachment to the parent builder.
|
EmailMessageBinaryAttachmentBuilder |
inline()
RARE: Sets the attachment type to
EmailMessageAttachmentType.INLINE and clears the attachment file name. |
EmailMessageBinaryAttachmentBuilder |
mimeType(String mimeType)
Sets the MIME type.
|
EmailMessageBuilder |
parent()
Access the parent email message builder
|
EmailMessageBuilder parent()
EmailMessageBinaryAttachmentBuilder attachmentFileName(String attachmentFileName)
Sets the attachment type to EmailMessageAttachmentType.ATTACHMENT and sets the attachment file name.
attachmentFileName - only a file name -- does not include a parent path
"binary_data.bin"inline()EmailMessageBinaryAttachmentBuilder inline()
EmailMessageAttachmentType.INLINE and clears the attachment file name.attachmentFileName(String)EmailMessageBinaryAttachmentBuilder mimeType(String mimeType)
"application/octet-stream".
See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
EmailMessageBinaryAttachmentBuilder attachMessage(javax.mail.Message message) throws Exception
message - MIME message to attachException - on I/O exceptionJavaMailMessageService.getMimeContentAsByteArr(Message),
attachBinaryFile(File, IsEmptyAllowed),
attachBinaryInputStream(InputStream, IsEmptyAllowed),
attachBinaryData(byte[], IsEmptyAllowed)EmailMessageBinaryAttachmentBuilder attachBinaryFile(File filePath, IsEmptyAllowed isEmptyAllowed) throws Exception
filePath - path to file with textisEmptyAllowed - normally, use IsEmptyAllowed.NOException - on I/O exception
isEmptyAllowed is IsEmptyAllowed.NO and the file is emptyattachMessage(Message),
attachBinaryInputStream(InputStream, IsEmptyAllowed),
attachBinaryData(byte[], IsEmptyAllowed)EmailMessageBinaryAttachmentBuilder attachBinaryInputStream(InputStream inputStream, IsEmptyAllowed isEmptyAllowed) throws Exception
InputStream as binary data,
then adds new attachment to the parent builder.inputStream - unlike most Java APIs, the input stream is closed after reading. This is the source or many hidden bugs!
InputStream.close()isEmptyAllowed - normally, use IsEmptyAllowed.NOException - on I/O exception
isEmptyAllowed is IsEmptyAllowed.NO and inputStream is emptyattachMessage(Message),
attachBinaryFile(File, IsEmptyAllowed),
attachBinaryData(byte[], IsEmptyAllowed)EmailMessageBinaryAttachmentBuilder attachBinaryData(byte[] byteArr, IsEmptyAllowed isEmptyAllowed)
byteArr - byte array for attachmentisEmptyAllowed - normally, use IsEmptyAllowed.NOIllegalArgumentException - if isEmptyAllowed is IsEmptyAllowed.NO and byteArr is emptyattachMessage(Message),
attachBinaryFile(File, IsEmptyAllowed),
attachBinaryInputStream(InputStream, IsEmptyAllowed)Copyright © 2013–2020. All rights reserved.