Package com.adobe.forms.common.service
Class FileAttachmentWrapper
- java.lang.Object
-
- com.adobe.forms.common.service.FileAttachmentWrapper
-
- All Implemented Interfaces:
java.io.Serializable
public class FileAttachmentWrapper extends java.lang.Object implements java.io.SerializableThe FileAttachmentWrapper captures the set of parameters required to represent the data of file attachment component. An instance of this class is available during form submission, which could be used to fetch the file attachment data for further processing. This is also used to prefill file attachmentPrefillDatadata in the form.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FileAttachmentWrapper(java.lang.String fileName, java.lang.String contentType, byte[] bytes)Creates file attachment wrapper object using file name, content type and file binary as bytesFileAttachmentWrapper(java.lang.String fileName, java.lang.String contentType, byte[] bytes, java.lang.String dataRef)Creates file attachment wrapper object using file name, content type, file binary as bytes and reference to the data modelFileAttachmentWrapper(java.lang.String fileName, java.lang.String contentType, byte[] bytes, java.lang.String uri, java.lang.String dataRef)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.StringgetContentType()Returns the content type of the file binaryjava.lang.StringgetDataRef()Returns reference to the data modeljava.lang.StringgetFileName()Deprecated.java.lang.StringgetFileNameV2()Returns the file name of the file attachmentjava.io.InputStreamgetInputStream()Returns input stream for the bytesjava.lang.StringgetUri()URI of file attachment wrapper.java.lang.StringgetUuid()Returns the unique identifier of the file attachmentbyte[]getValue()Returns the bytes for the binaryvoidsetContentType(java.lang.String contentType)Sets the content type of the file binaryvoidsetDatRef(java.lang.String dataRef)Sets the reference to the data modelvoidsetFileName(java.lang.String fileName)Sets the file name of the file attachmentvoidsetUri(java.lang.String uri)Sets the URI of the file attachmentvoidsetUuid(java.lang.String uuid)sets unique identifier for the file attachmentsjava.lang.StringtoJson()Returns serialized version of file attachment wrapper as a json string
-
-
-
Constructor Detail
-
FileAttachmentWrapper
public FileAttachmentWrapper(java.lang.String fileName, java.lang.String contentType, byte[] bytes)Creates file attachment wrapper object using file name, content type and file binary as bytes- Parameters:
fileName- file namecontentType- content type of the file binarybytes- bytes of the file
-
FileAttachmentWrapper
public FileAttachmentWrapper(java.lang.String fileName, java.lang.String contentType, byte[] bytes, java.lang.String dataRef)Creates file attachment wrapper object using file name, content type, file binary as bytes and reference to the data model- Parameters:
fileName- file namecontentType- content type of the file binarybytes- byte of the filedataRef- reference to the data model
-
FileAttachmentWrapper
public FileAttachmentWrapper(java.lang.String fileName, java.lang.String contentType, byte[] bytes, java.lang.String uri, java.lang.String dataRef)
-
-
Method Detail
-
getFileName
public java.lang.String getFileName()
Deprecated.Returns the file name of the file attachment. This additionally also contains the name of the component in it (for example) if component name is abc and file name is xyz.pdf, then this would return abc/xyz.pdf- Returns:
- {String} file name
-
getFileNameV2
public java.lang.String getFileNameV2()
Returns the file name of the file attachment- Returns:
- {String} file name
-
getContentType
public java.lang.String getContentType()
Returns the content type of the file binary- Returns:
- {String} content type
-
getDataRef
public java.lang.String getDataRef()
Returns reference to the data model- Returns:
- {String} reference to the data model
-
setFileName
public void setFileName(java.lang.String fileName)
Sets the file name of the file attachment- Parameters:
fileName- file name of the attachment
-
setUri
public void setUri(java.lang.String uri)
Sets the URI of the file attachment- Parameters:
uri- uri of the file attachment
-
setContentType
public void setContentType(java.lang.String contentType)
Sets the content type of the file binary- Parameters:
contentType- content type of the file binary
-
setDatRef
public void setDatRef(java.lang.String dataRef)
Sets the reference to the data model- Parameters:
dataRef- reference to the data model
-
getInputStream
public java.io.InputStream getInputStream()
Returns input stream for the bytes- Returns:
- {InputStream} input stream of bytes
-
getValue
public byte[] getValue()
Returns the bytes for the binary- Returns:
- {byte}
-
getUri
public java.lang.String getUri()
URI of file attachment wrapper. This could be a URI (dataURL) or base 64 encoded binary URI- Returns:
- {String} uri of the file binary
-
getUuid
public java.lang.String getUuid()
Returns the unique identifier of the file attachment- Returns:
-
setUuid
public void setUuid(java.lang.String uuid)
sets unique identifier for the file attachments- Parameters:
uuid- {String} uuid represented as string
-
toJson
public java.lang.String toJson()
Returns serialized version of file attachment wrapper as a json string- Returns:
- {String} json representing file attachment wrapper
-
-