Class ResourceType

java.lang.Object
com.cksource.ckfinder.resourcetype.ResourceType

public class ResourceType extends Object
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 Details

  • Method Details

    • getBackend

      public Backend getBackend()
      Returns backend used by this resource type.
      Returns:
      backend used by this resource type
    • getName

      public String getName()
      Returns the name of this resource type.
      Returns:
      name of this resource type
    • getAllowedExtensions

      public Set<String> 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

      public String 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

      public String 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

      public Set<String> 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

      public String 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

      public String getLabel()
      Returns the label defined for this resource type.
      Returns:
      label defined for this resource type
    • getUrl

      public String 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

      public boolean isAllowedExtension(String ext)
      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

      public String getHash()
      Returns the resource type hash.
      Returns:
      resource type hash