Class SendMessageMessageAttachmentData
- java.lang.Object
-
- de.xima.fc.form_record.api.message.SendMessageMessageAttachmentData
-
- All Implemented Interfaces:
IFileData
,ISendMessageAttachmentData
,Serializable
public class SendMessageMessageAttachmentData extends Object implements ISendMessageAttachmentData
Default POJO implementation ofISendMessageAttachmentData
- Since:
- 8.4.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SendMessageMessageAttachmentData(IFileData fileData)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
content()
Required.String
contentType()
Required.String
fileName()
Required.static ISendMessageAttachmentData
ofBinaryContent(byte[] content, String fileName, String contentType)
Creates a new POJO for form record message attachment with the given binary content.static ISendMessageAttachmentData
ofFile(Path file, String fileName, String mimeType)
Creates a new POJO for an attachment of a form record message, using the given file.
-
-
-
Constructor Detail
-
SendMessageMessageAttachmentData
public SendMessageMessageAttachmentData(IFileData fileData)
-
-
Method Detail
-
content
public byte[] content()
Description copied from interface:IFileData
Required. The binary content of the file.
-
fileName
public String fileName()
Description copied from interface:IFileData
Required. The name of the file.
-
contentType
public String contentType()
Description copied from interface:IFileData
Required. The MIME type of the file.- Specified by:
contentType
in interfaceIFileData
- Returns:
- The MIME type of the file.
-
ofBinaryContent
public static ISendMessageAttachmentData ofBinaryContent(byte[] content, String fileName, String contentType)
Creates a new POJO for form record message attachment with the given binary content.- Parameters:
content
- The binary content of the form record message attachment. null is treated as an empty array.fileName
- The name of the attachment.contentType
- The MIME type of the attachment.- Returns:
- A new POJO for the data of an attachment.
-
ofFile
public static ISendMessageAttachmentData ofFile(Path file, String fileName, String mimeType) throws IOException
Creates a new POJO for an attachment of a form record message, using the given file.- Parameters:
file
- The attachment file. null is treated as an empty file.fileName
- The name of the attachment file.mimeType
- The MIME type of the attachment.- Returns:
- A new POJO for data of a attachment.
- Throws:
IOException
- When the data of the given attachment could not be read.
-
-