public class DefaultMimeMappingStrategy extends java.lang.Object implements MimeMappingStrategy
MimeMappingStrategy implementation backed by the hybris configuration (project.properties,
local.properties et. al.).
You can register further mime type mapping by adding the following properties:
media.customextension.<mimetype>=<extension> to your propertiesmedia.customextension.application.vnd.ms-excel=xls media.customextension.application.vnd.ms-powerpoint=ppt media.customextension.application.vnd.visio=vsdSee the
advanced.properties for predefined mime types.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PROPERTY_FILEEXTENSION_PREFIX
The property to retrieve the mime type by a file extension.
|
static java.lang.String |
PROPERTY_NAME_PREFIX
Configuration key prefix of mime type mappings.
|
| Constructor and Description |
|---|
DefaultMimeMappingStrategy() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
determineMimeTypeByFileName(java.lang.String fileName)
Determines the mime type by the file extension fo the given file name.
|
java.lang.String |
fileExtensionForMimeType(java.lang.String mimeType)
Computes the file extension (e.g.
|
ConfigurationService |
getConfigurationService()
Accesses the
ConfigurationService to use. |
void |
setConfigurationService(ConfigurationService configurationService)
Sets the
ConfigurationService to use. |
public static final java.lang.String PROPERTY_NAME_PREFIX
public static final java.lang.String PROPERTY_FILEEXTENSION_PREFIX
public java.lang.String fileExtensionForMimeType(java.lang.String mimeType)
fileExtensionForMimeType in interface MimeMappingStrategymimeType - the mime type to get the file extension for.null if the specified mimeType is unknown
or could not be mapped to a file extension.MimeMappingStrategy.fileExtensionForMimeType(String)public java.lang.String determineMimeTypeByFileName(java.lang.String fileName)
determineMimeTypeByFileName in interface MimeMappingStrategyfileName - The name of the file withou pathnull if no such mimetype is registered.MimeMappingStrategy.determineMimeTypeByFileName(java.lang.String)public ConfigurationService getConfigurationService()
ConfigurationService to use.ConfigurationService to use.public void setConfigurationService(ConfigurationService configurationService)
ConfigurationService to use. This is a Spring IoC accessor.configurationService - the ConfigurationService to use.Copyright © 2018 SAP SE. All Rights Reserved.