public class DefaultMimeMappingStrategy extends 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 String |
PROPERTY_FILEEXTENSION_PREFIX
The property to retrieve the mime type by a file extension.
|
static String |
PROPERTY_NAME_PREFIX
Configuration key prefix of mime type mappings.
|
| Constructor and Description |
|---|
DefaultMimeMappingStrategy() |
| Modifier and Type | Method and Description |
|---|---|
String |
determineMimeTypeByFileName(String fileName)
Determines the mime type by the file extension fo the given file name.
|
String |
fileExtensionForMimeType(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 String PROPERTY_NAME_PREFIX
public static final String PROPERTY_FILEEXTENSION_PREFIX
public String fileExtensionForMimeType(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 String determineMimeTypeByFileName(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 © 2017 SAP SE. All Rights Reserved.