public interface MimeService
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getBestExtensionFromMime(java.lang.String mime)
Gets the best matching extension from mime.
|
java.lang.String |
getBestMime(java.lang.String fileName,
byte[] firstBytes,
java.lang.String overrideMime)
Gets the best mime.
|
java.lang.String |
getFileExtensionFromMime(java.lang.String mime)
Gets the file extension from provided mime or null if it cannot be found in configuration properties.
|
java.lang.String |
getMimeFromFileExtension(java.lang.String fileName)
Gets the mime from file extension or null if it cannot be found in configuration properties.
|
java.lang.String |
getMimeFromFirstBytes(byte[] firstBytes)
Gets the mime from first bytes of data or null if it cannot be determined.
|
java.util.Set<java.lang.String> |
getSupportedMimeTypes()
Gets set of supported mime types.
|
boolean |
isZipRelatedMime(java.lang.String mime)
Checks whether provided mime is zip related mime.
|
java.lang.String getFileExtensionFromMime(java.lang.String mime)
mime - the mime to checkjava.lang.String getBestExtensionFromMime(java.lang.String mime)
mime - the mime to checkjava.lang.String getMimeFromFileExtension(java.lang.String fileName)
fileName - the file name to checkjava.lang.String getMimeFromFirstBytes(byte[] firstBytes)
firstBytes - the first bytes of datajava.lang.String getBestMime(java.lang.String fileName,
byte[] firstBytes,
java.lang.String overrideMime)
fileName extension. If it cannot be
determined provided firstBytes of data are used to dermine mime. If it fail then
overrideMime may be used if it is on list of supported mime types (look for
media.customextension keys in advanced.properties file for supported mime types and file
extensions). Finally if it fail than default mime is returned which is always application/octet-stream.fileName - the file name to checkfirstBytes - the first bytes of dataoverrideMime - the override mimejava.util.Set<java.lang.String> getSupportedMimeTypes()
boolean isZipRelatedMime(java.lang.String mime)
mime - the mime to checkCopyright © 2018 SAP SE. All Rights Reserved.