Package com.day.cq.dam.commons.util
Interface DamMimeUtils
- 
@ProviderType public interface DamMimeUtilsThis 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 booleangetDetectMimeFromContent()Returns of content-based-MIME-detection is enabledbooleanisAllowedMimeType(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 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(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/whitelisted 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 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
 
 
 - 
 
 -