Package com.jalios.jcms.upload
Class FileUploadOptions
java.lang.Object
com.jalios.jcms.upload.FileUploadOptions
Memo class holding all upload option.
- Since:
- jcms-10.0.6 / JCMS-8317
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCheck if image file should be automatically rotated based on its EXIF informationautoRotate(Boolean autoRotate) Set wether image file should be automatically rotated based on its EXIF information.static FileUploadOptionsUtility method to retrieve a new FileUploadOptions instance suitable for FileDocument upload.Class<? extends FileDocument> booleansetAuthorizedExtensions(String... authorizedExtensions) Set the extensions authorized for upload.setAuthorizedExtensions(Set<String> authorizedExtensions) Set the extensions authorized for upload.setContentType(String contentType) Set the content type to use, regardless of value received in request.setFileDocument(boolean fileDocument) Set wether the upload will be performed for FileDocument or for any other use.setPreferredClass(Class<? extends FileDocument> preferredClass) Set the FileDocument class to preferred for upload if enabled and authorized.
-
Constructor Details
-
FileUploadOptions
public FileUploadOptions()
-
-
Method Details
-
getFileDocumentUploadOptions
Utility method to retrieve a new FileUploadOptions instance suitable for FileDocument upload.- Returns:
- a new instance of FileUploadOptions
-
setFileDocument
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
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
-
setPreferredClass
Set the FileDocument class to preferred for upload if enabled and authorized.- Parameters:
preferredClass- a FileDocument class- Returns:
- this instance for method chaining
-
getPreferredClass
-
setAuthorizedExtensions
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
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
-
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
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
-