public class ResourceType extends Object
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 and Description |
---|
ResourceType(Config.ResourceType config,
Backend backend) |
Modifier and Type | Method and Description |
---|---|
Set<String> |
getAllowedExtensions()
Returns a set of file name extensions allowed for this resource type.
|
String |
getAllowedExtensionsAsString()
Returns a list of file name extensions allowed for this resource type.
|
Backend |
getBackend()
Returns backend used by this resource type.
|
Set<String> |
getDeniedExtensions()
Returns a set of file name extensions disallowed for this resource type.
|
String |
getDeniedExtensionsAsString()
Returns a list of file name extensions disallowed for this resource type.
|
String |
getDirectory()
Returns the directory path defined for this resource type.
|
String |
getHash()
Returns the resource type hash.
|
String |
getLabel()
Returns the label defined for this resource type.
|
long |
getMaxSize()
Returns the maximum file size allowed for this resource type.
|
String |
getName()
Returns the name of this resource type.
|
String |
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.
|
public ResourceType(Config.ResourceType config, Backend backend)
public Backend getBackend()
public String getName()
public Set<String> getAllowedExtensions()
public String getAllowedExtensionsAsString()
public String getDirectory()
public Set<String> getDeniedExtensions()
public String getDeniedExtensionsAsString()
public long getMaxSize()
0
if no limit is definedpublic String getLabel()
public String getUrl()
null
if it cannot be determinedpublic boolean isAllowedExtension(String ext)
ext
- file name extensionpublic boolean isAllowedFileSize(long fileSize)
fileSize
- file size in bytespublic String getHash()
Copyright © 2007 – 2019 CKSource - Frederico Knabben. All rights reserved.