Interface MimeMappingStrategy
- All Known Implementing Classes:
DefaultMimeMappingStrategy
public interface MimeMappingStrategy
Strategy to compute a file's extension for a given mime type.
-
Method Summary
Modifier and TypeMethodDescriptiondetermineMimeTypeByFileName(String fileName) Determines the mime type by the file extension fo the given file name.fileExtensionForMimeType(String mimeType) Computes the file extension (e.g.
-
Method Details
-
fileExtensionForMimeType
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
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.
-