Class ResourceType
java.lang.Object
com.cksource.ckfinder.resourcetype.ResourceType
Defines a resource type.
Resource types can be considered as top folders or root elements in the CKFinder's directory hierarchy. Each resource type has its own set of configuration options.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a set of file name extensions allowed for this resource type.Returns a list of file name extensions allowed for this resource type.Returns backend used by this resource type.Returns a set of file name extensions disallowed for this resource type.Returns a list of file name extensions disallowed for this resource type.Returns the directory path defined for this resource type.getHash()
Returns the resource type hash.getLabel()
Returns the label defined for this resource type.long
Returns the maximum file size allowed for this resource type.getName()
Returns the name of this resource type.getUrl()
Returns the base URL of this resource type.boolean
isAllowedExtension
(String ext) Checks if file with provided file name extension can be saved in this resource type.boolean
isAllowedFileSize
(long fileSize) Checks if provided file size can be saved in this resource type.
-
Constructor Details
-
ResourceType
-
-
Method Details
-
getBackend
Returns backend used by this resource type.- Returns:
- backend used by this resource type
-
getName
Returns the name of this resource type.- Returns:
- name of this resource type
-
getAllowedExtensions
Returns a set of file name extensions allowed for this resource type.- Returns:
- set of file name extensions allowed for this resource type
-
getAllowedExtensionsAsString
Returns a list of file name extensions allowed for this resource type.- Returns:
- comma-delimited string containing file name extensions allowed for this resource type
-
getDirectory
Returns the directory path defined for this resource type. The returned directory path is backend-relative.- Returns:
- directory path defined for this resource type
-
getDeniedExtensions
Returns a set of file name extensions disallowed for this resource type.- Returns:
- set of file name extensions disallowed for this resource type
-
getDeniedExtensionsAsString
Returns a list of file name extensions disallowed for this resource type.- Returns:
- comma-delimited string containing file name extensions disallowed for this resource type
-
getMaxSize
public long getMaxSize()Returns the maximum file size allowed for this resource type.- Returns:
- maximum file size allowed for this resource type or
0
if no limit is defined
-
getLabel
Returns the label defined for this resource type.- Returns:
- label defined for this resource type
-
getUrl
Returns the base URL of this resource type.- Returns:
- the base URL of this resource type or
null
if it cannot be determined
-
isAllowedExtension
Checks if file with provided file name extension can be saved in this resource type.- Parameters:
ext
- file name extension- Returns:
- true if file name extension is allowed for this resource type, false otherwise
-
isAllowedFileSize
public boolean isAllowedFileSize(long fileSize) Checks if provided file size can be saved in this resource type.- Parameters:
fileSize
- file size in bytes- Returns:
- true if file size is allowed for this resource type, false otherwise
-
getHash
Returns the resource type hash.- Returns:
- resource type hash
-