Interface DamMimeUtils


  • @ProviderType
    public interface DamMimeUtils
    This class provides various utility methods pertaining to DAM Mime Type Service Implementation.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean getDetectMimeFromContent()
      Returns of content-based-MIME-detection is enabled
      boolean isAllowedMimeType​(java.lang.String nameMimeType, java.lang.String contentMimeType)
      Based on current state of the service, this method evaluates if currently provided MIME (as detected from asset name, and optionally asset content) is allowed for upload or not
      void setAllowAllMimeAttribute​(boolean val)
      This method updates the status of 'cq.dam.allow.all.mime' property of "Day CQ DAM Asset Upload Restriction" OSGi configuration in the DamMimeUtil service
      void setDetectMimeFromContent​(boolean val)
      This method updates the status of 'cq.dam.detect.asset.mime.from.content' property of "Day CQ DAM Mime Type Service" OSGi configuration
      void setSupportedMimeTypes​(java.lang.String[] mimeList)
      This method updates the status of 'cq.dam.allowed.asset.mimes' property of "Day CQ DAM Asset Upload Restriction" OSGi configuration in the DamMimeUtil service
    • Method Detail

      • setAllowAllMimeAttribute

        void setAllowAllMimeAttribute​(boolean val)
        This method updates the status of 'cq.dam.allow.all.mime' property of "Day CQ DAM Asset Upload Restriction" OSGi configuration in the DamMimeUtil service
        Parameters:
        val - the value to update service with
      • setDetectMimeFromContent

        void setDetectMimeFromContent​(boolean val)
        This method updates the status of 'cq.dam.detect.asset.mime.from.content' property of "Day CQ DAM Mime Type Service" OSGi configuration
        Parameters:
        val - the value to update service with
      • setSupportedMimeTypes

        void setSupportedMimeTypes​(java.lang.String[] mimeList)
        This method updates the status of 'cq.dam.allowed.asset.mimes' property of "Day CQ DAM Asset Upload Restriction" OSGi configuration in the DamMimeUtil service
        Parameters:
        mimeList - an array of regex-strings specifying supported/allowed MIMEs
      • isAllowedMimeType

        boolean isAllowedMimeType​(java.lang.String nameMimeType,
                                  java.lang.String contentMimeType)
        Based on current state of the service, this method evaluates if currently provided MIME (as detected from asset name, and optionally asset content) is allowed for upload or not
        Parameters:
        nameMimeType - MIME of the asset as detected from its name
        contentMimeType - MIME of the asset as detected from its content (can be null, but if present is preferred over nameMimeType)
        Returns:
        true if upload is allowed, false otherwise
      • getDetectMimeFromContent

        boolean getDetectMimeFromContent()
        Returns of content-based-MIME-detection is enabled
        Returns:
        true if enabled, false otherwise