Class FileUpload

  • All Implemented Interfaces:
    IEntity, Serializable, org.apache.cayenne.DataObject, org.apache.cayenne.Persistent, org.apache.cayenne.Validating

    public class FileUpload
    extends _FileUpload
    Provides an entity containing information about a file uploaded to SmartForm Manager.
    See Also:
    Serialized Form
    • Field Detail

      • TYPE_EMBEDDED

        public static final String TYPE_EMBEDDED
        Indicates that the file was submitted as an embedded attachment
        See Also:
        Constant Field Values
      • TYPE_SIGNED_RECEIPT

        public static final String TYPE_SIGNED_RECEIPT
        Indicates that the file is the receipt signed in wet ink by the user
        See Also:
        Constant Field Values
      • TYPE_SUBMITTED_FORM

        public static final String TYPE_SUBMITTED_FORM
        Indicates that the file is the submitted PDF form
        See Also:
        Constant Field Values
      • TYPE_SYSTEM

        public static final String TYPE_SYSTEM
        Indicates that the file is system added file attachment.
        See Also:
        Constant Field Values
      • TYPE_UPLOAD

        public static final String TYPE_UPLOAD
        Indicates that the file has been uploaded by the user as a SmartForm Manager managed attachment
        See Also:
        Constant Field Values
      • TYPES

        public static final List<String> TYPES
        Provides a list of available type.
      • VIRUS_STATUS_SCAN_ERROR

        public static final String VIRUS_STATUS_SCAN_ERROR
        Indicates that virus scanning did not complete due to an error
        See Also:
        Constant Field Values
      • VIRUS_STATUS_CLEAN

        public static final String VIRUS_STATUS_CLEAN
        Indicates that the file was virus scanned and found to be clean
        See Also:
        Constant Field Values
      • VIRUS_STATUS_VIRUS

        public static final String VIRUS_STATUS_VIRUS
        Indicates that the file was virus scanned and found to be contain a virus
        See Also:
        Constant Field Values
      • VIRUS_STATUS_NO_DATA

        public static final String VIRUS_STATUS_NO_DATA
        Indicates that the file could not be virus scanned as no file data was available
        See Also:
        Constant Field Values
    • Constructor Detail

      • FileUpload

        public FileUpload()
    • Method Detail

      • getSizeFormatted

        public String getSizeFormatted()
        Return the file size as a formatted string
        Returns:
        the formatted file size
      • isUploaded

        public boolean isUploaded()
        Determine whether the file was uploaded by the user for a SmartForm Manager managed attachment
        Returns:
        true if the type equals TYPE_UPLOAD
      • isSubmittedForm

        public boolean isSubmittedForm()
        Determine whether the file is the submitted PDF form
        Returns:
        true if the type equals TYPE_SUBMITTED_FORM
      • isEmbedded

        public boolean isEmbedded()
        Determine whether the file was submitted as an embedded attachment
        Returns:
        true if the type equals TYPE_EMBEDDED
      • isVirusStatusClean

        public boolean isVirusStatusClean()
        Determine whether the file has been found to be clean by the virus scanner
        Returns:
        true if the virus status is VIRUS_STATUS_CLEAN
        Since:
        4.1.0
      • isVirusStatusError

        public boolean isVirusStatusError()
        Returns:
        true if the virus status is VIRUS_STATUS_SCAN_ERROR
        Since:
        4.3.2
      • isVirusStatusVirus

        public boolean isVirusStatusVirus()
        Determine whether the file has been found to be infected by the virus scanner
        Returns:
        true if the virus status is VIRUS_STATUS_VIRUS
        Since:
        4.1.0
      • setFileUploadData

        @Deprecated
        public void setFileUploadData​(FileUploadData fileUploadData)
        Deprecated.
        This method should not be used, instead please use the submissions associated Submission Data Storage service.
        Overrides:
        setFileUploadData in class _FileUpload
        Parameters:
        fileUploadData - the fileUploadData value to set
        Since:
        4.2.0
      • getFileUploadData

        @Deprecated
        public FileUploadData getFileUploadData()
        Deprecated.
        This method should not be used, instead please use the submissions associated Submission Data Storage service.
        Overrides:
        getFileUploadData in class _FileUpload
        Returns:
        the fileUploadData value
        Since:
        4.2.0
      • getSafeFileName

        public String getSafeFileName()
        Returns:
        a safe filename with illegal Windows OS characters and URL characters replaced with '_' character
        Since:
        4.3.0