Class FileUpload

java.lang.Object
org.apache.cayenne.PersistentObject
org.apache.cayenne.BaseDataObject
org.apache.cayenne.CayenneDataObject
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:
  • Field Details

    • TYPE_EMBEDDED

      public static final String TYPE_EMBEDDED
      Indicates that the file was submitted as an embedded attachment
      See Also:
    • TYPE_SUBMITTED_FORM

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

      public static final String TYPE_SYSTEM
      Indicates that the file is system added file attachment.
      See Also:
    • 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:
    • 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:
    • VIRUS_STATUS_CLEAN

      public static final String VIRUS_STATUS_CLEAN
      Indicates that the file was virus scanned and found to be clean
      See Also:
    • 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:
    • 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:
  • Constructor Details

    • FileUpload

      public FileUpload()
  • Method Details

    • 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
    • setUploadTimestamp

      public void setUploadTimestamp(Date uploadTimestamp)
      Description copied from class: _FileUpload
      Set the uploadTimestamp value.
      Overrides:
      setUploadTimestamp in class _FileUpload
      Parameters:
      uploadTimestamp - the uploadTimestamp value to set
    • setDeletedTimestamp

      public void setDeletedTimestamp(Date deletedTimestamp)
      Description copied from class: _FileUpload
      Set the deletedTimestamp value.
      Overrides:
      setDeletedTimestamp in class _FileUpload
      Parameters:
      deletedTimestamp - the deletedTimestamp value to set