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.
  • Field Details

  • Constructor Details

  • Method Details

    • checkTypeAllowed

      public boolean checkTypeAllowed(String path, String extension)
      Check if a given file extension is allowed for the given upload path.
      Parameters:
      path - the root path of the upload folder
      extension - 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

      public boolean isUploadEnabled(String originalPath)
      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

      protected Set<String> getTypes(String path)
      Gets the valid extensions for uploads to a given upload folder
      Parameters:
      path - the upload folder root path
      Returns:
      the valid extensions