Package org.opencms.gwt.shared
Class CmsUploadRestrictionInfo
java.lang.Object
org.opencms.gwt.shared.CmsUploadRestrictionInfo
- All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable
public class CmsUploadRestrictionInfo
extends Object
implements com.google.gwt.user.client.rpc.IsSerializable
Contains information about which folders should restrict uploads.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Helper class for building a new CmsUploadRestrictionInfo object. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
checkTypeAllowed
(String path, String extension) Check if a given file extension is allowed for the given upload path.getAcceptAttribute
(String path) Gets the 'accept' attribute to use for the file input element for the given upload folder.Gets the valid extensions for uploads to a given upload folderboolean
isUploadEnabled
(String originalPath) Checks if the upload should be enabled for the given upload path.
-
Field Details
-
KEY_ENABLED
The 'enabled' key.- See Also:
-
KEY_TYPES
The 'types' key.- See Also:
-
UNRESTRICTED_UPLOADS
The default upload restriction that allows everything.- See Also:
-
-
Constructor Details
-
CmsUploadRestrictionInfo
protected CmsUploadRestrictionInfo()Creates a new instance.
-
-
Method Details
-
checkTypeAllowed
Check if a given file extension is allowed for the given upload path.- Parameters:
path
- the root path of the upload folderextension
- the file extension to check- Returns:
- true if the file extension is valid for uploads to the folder
-
getAcceptAttribute
Gets the 'accept' attribute to use for the file input element for the given upload folder.- Parameters:
path
- the upload folder root path- Returns:
- the 'accept' attribute that should be used for the file input
-
isUploadEnabled
Checks if the upload should be enabled for the given upload path.- Parameters:
originalPath
- the upload root path- Returns:
- true if the upload is enabled
-
getTypes
Gets the valid extensions for uploads to a given upload folder- Parameters:
path
- the upload folder root path- Returns:
- the valid extensions
-