Package com.jalios.jcms.upload
Class FileUploadOptions
- java.lang.Object
-
- com.jalios.jcms.upload.FileUploadOptions
-
public class FileUploadOptions extends java.lang.ObjectMemo class holding all upload option.- Since:
- jcms-10.0.6 / JCMS-8317
-
-
Constructor Summary
Constructors Constructor Description FileUploadOptions()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<java.lang.String>getAuthorizedExtensions()java.lang.StringgetContentType()static FileUploadOptionsgetFileDocumentUploadOptions()Utility method to retrieve a new FileUploadOptions instance suitable for FileDocument upload.java.lang.Class<? extends FileDocument>getPreferredClass()booleanisFileDocument()FileUploadOptionssetAuthorizedExtensions(java.lang.String... authorizedExtensions)Set the extensions authorized for upload.FileUploadOptionssetAuthorizedExtensions(java.util.Set<java.lang.String> authorizedExtensions)Set the extensions authorized for upload.FileUploadOptionssetContentType(java.lang.String contentType)Set the content type to use, regardless of value received in request.FileUploadOptionssetFileDocument(boolean fileDocument)Set wether the upload will be performed for FileDocument or for any other use.FileUploadOptionssetPreferredClass(java.lang.Class<? extends FileDocument> preferredClass)Set the FileDocument class to preferred for upload if enabled and authorized.
-
-
-
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()
-
-