Interface MimeMappingStrategy
-
- All Known Implementing Classes:
DefaultMimeMappingStrategy
public interface MimeMappingStrategyStrategy to compute a file's extension for a given mime type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringdetermineMimeTypeByFileName(java.lang.String fileName)Determines the mime type by the file extension fo the given file name.java.lang.StringfileExtensionForMimeType(java.lang.String mimeType)Computes the file extension (e.g.
-
-
-
Method Detail
-
fileExtensionForMimeType
java.lang.String fileExtensionForMimeType(java.lang.String mimeType)
Computes the file extension (e.g. 'gif' for 'image/gif', 'jpg' for 'image/jpeg') for the given mimetype.- Parameters:
mimeType- the mime type to get the file extension for.- Returns:
- the file extension without a leading dot, or
nullif the specified mimeType is unknown or could not be mapped to a file extension.
-
determineMimeTypeByFileName
java.lang.String determineMimeTypeByFileName(java.lang.String fileName)
Determines the mime type by the file extension fo the given file name.- Parameters:
fileName- The name of the file withou path- Returns:
- The mime type or
nullif no such mimetype is registered.
-
-