Class SendMessageMessageAttachmentData

    • 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.
        Specified by:
        content in interface IFileData
        Returns:
        The content of the file.
      • fileName

        public String fileName()
        Description copied from interface: IFileData
        Required. The name of the file.
        Specified by:
        fileName in interface IFileData
        Returns:
        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 interface IFileData
        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.