Class FileUploadOptions

java.lang.Object
com.jalios.jcms.upload.FileUploadOptions

public class FileUploadOptions extends Object
Memo class holding all upload option.
Since:
jcms-10.0.6 / JCMS-8317
  • Constructor Details

    • FileUploadOptions

      public FileUploadOptions()
  • Method Details

    • getFileDocumentUploadOptions

      public static FileUploadOptions getFileDocumentUploadOptions()
      Utility method to retrieve a new FileUploadOptions instance suitable for FileDocument upload.
      Returns:
      a new instance of FileUploadOptions
    • setFileDocument

      public FileUploadOptions setFileDocument(boolean fileDocument)
      Set wether the upload will be performed for FileDocument or for any other use.
      Parameters:
      fileDocument - true to request upload processing targeted to FileDocument upload, false to request upload processing target to any common file
      Returns:
      this instance for method chaining
    • isFileDocument

      public boolean isFileDocument()
    • setContentType

      public FileUploadOptions setContentType(String contentType)
      Set the content type to use, regardless of value received in request.
      Parameters:
      contentType - a content type string, or null to use value received in request
      Returns:
      this instance for method chaining
    • getContentType

      public String getContentType()
    • setPreferredClass

      public FileUploadOptions setPreferredClass(Class<? extends FileDocument> preferredClass)
      Set the FileDocument class to preferred for upload if enabled and authorized.
      Parameters:
      preferredClass - a FileDocument class
      Returns:
      this instance for method chaining
    • getPreferredClass

      public Class<? extends FileDocument> getPreferredClass()
    • setAuthorizedExtensions

      public FileUploadOptions setAuthorizedExtensions(Set<String> authorizedExtensions)
      Set the extensions authorized for upload.

      Leave empty to accept all extensions authorized in the default JPlatform configuration.

      Parameters:
      authorizedExtensions - a Set of lower case extension (without the dot)
      Returns:
      this instance for method chaining
    • setAuthorizedExtensions

      public FileUploadOptions setAuthorizedExtensions(String... authorizedExtensions)
      Set the extensions authorized for upload.

      Leave empty to accept all extensions authorized in default JPlatform configuration.

      Parameters:
      authorizedExtensions - a Set of lower case extension (without the dot)
      Returns:
      this instance for method chaining
    • getAuthorizedExtensions

      public Set<String> getAuthorizedExtensions()
    • autoRotate

      public FileUploadOptions autoRotate(Boolean autoRotate)
      Set wether image file should be automatically rotated based on its EXIF information.
      Parameters:
      autoRotate - null to apply default JPlatform setting, true to request automatic rotation, false to leave file untouched
      Returns:
      this instance for method chaining
      Since:
      JCMS-11662
    • autoRotate

      public Boolean autoRotate()
      Check if image file should be automatically rotated based on its EXIF information
      Returns:
      null to apply default JPlatform setting, true if automatic rotation is enabled, false if file is left untouched
      Since:
      JCMS-11662