Class CmsUploadRestrictionInfo

  • All Implemented Interfaces:
    com.google.gwt.user.client.rpc.IsSerializable

    public class CmsUploadRestrictionInfo
    extends java.lang.Object
    implements com.google.gwt.user.client.rpc.IsSerializable
    Contains information about which folders should restrict uploads.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  CmsUploadRestrictionInfo.Builder
      Helper class for building a new CmsUploadRestrictionInfo object.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String KEY_ENABLED
      The 'enabled' key.
      static java.lang.String KEY_TYPES
      The 'types' key.
      static java.lang.String UNRESTRICTED_UPLOADS
      The default upload restriction that allows everything.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected CmsUploadRestrictionInfo()
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean checkTypeAllowed​(java.lang.String path, java.lang.String extension)
      Check if a given file extension is allowed for the given upload path.
      java.lang.String getAcceptAttribute​(java.lang.String path)
      Gets the 'accept' attribute to use for the file input element for the given upload folder.
      protected java.util.Set<java.lang.String> getTypes​(java.lang.String path)
      Gets the valid extensions for uploads to a given upload folder
      boolean isUploadEnabled​(java.lang.String originalPath)
      Checks if the upload should be enabled for the given upload path.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • checkTypeAllowed

        public boolean checkTypeAllowed​(java.lang.String path,
                                        java.lang.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

        public java.lang.String getAcceptAttribute​(java.lang.String path)
        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​(java.lang.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 java.util.Set<java.lang.String> getTypes​(java.lang.String path)
        Gets the valid extensions for uploads to a given upload folder
        Parameters:
        path - the upload folder root path
        Returns:
        the valid extensions