Interface DamMimeUtils


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

    Modifier and Type
    Method
    Description
    boolean
    Returns of content-based-MIME-detection is enabled
    boolean
    isAllowedMimeType(String nameMimeType, 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
    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
    This method updates the status of 'cq.dam.detect.asset.mime.from.content' property of "Day CQ DAM Mime Type Service" OSGi configuration
    void
    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 Details

    • 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(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(String nameMimeType, 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