Class FileUploadOptions


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

      • FileUploadOptions

        public FileUploadOptions()
    • Method Detail

      • 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​(java.lang.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 java.lang.String getContentType()
      • setPreferredClass

        public FileUploadOptions setPreferredClass​(java.lang.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 java.lang.Class<? extends FileDocument> getPreferredClass()
      • setAuthorizedExtensions

        public FileUploadOptions setAuthorizedExtensions​(java.util.Set<java.lang.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​(java.lang.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 java.util.Set<java.lang.String> getAuthorizedExtensions()