Package com.day.cq.dam.commons.util
Interface DamMimeUtils
This class provides various utility methods pertaining to DAM Mime Type Service Implementation.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns of content-based-MIME-detection is enabledbooleanisAllowedMimeType(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 notvoidsetAllowAllMimeAttribute(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 servicevoidsetDetectMimeFromContent(boolean val) This method updates the status of 'cq.dam.detect.asset.mime.from.content' property of "Day CQ DAM Mime Type Service" OSGi configurationvoidsetSupportedMimeTypes(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 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
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
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 namecontentMimeType- 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
-