java.lang.Object
io.inverno.mod.base.resource.GenericMediaTypeService
- All Implemented Interfaces:
MediaTypeService
A generic MediaTypeService implementation.
This implementation relies on the installed FileTypeDetector implementation to determine the media type of a file.
- Since:
- 1.0
- Author:
- Jeremy Kuhn
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetForExtension(String extension) Determines the media type of the specified file extension.getForFilename(String filename) Determines the media type of the specified file name.getForPath(Path path) Determines the media type of the specified path.Determines the media type of the specified path.
-
Constructor Details
-
GenericMediaTypeService
public GenericMediaTypeService()
-
-
Method Details
-
getForExtension
Description copied from interface:MediaTypeServiceDetermines the media type of the specified file extension.
- Specified by:
getForExtensionin interfaceMediaTypeService- Parameters:
extension- a file extension- Returns:
- a media type or null if no known media type has been found for the specified file extension
-
getForFilename
Description copied from interface:MediaTypeServiceDetermines the media type of the specified file name.
- Specified by:
getForFilenamein interfaceMediaTypeService- Parameters:
filename- a file name- Returns:
- a media type or null if no known media type has been found for the specified file name
-
getForPath
Description copied from interface:MediaTypeServiceDetermines the media type of the specified path.
- Specified by:
getForPathin interfaceMediaTypeService- Parameters:
path- a path- Returns:
- a media type or null if no known media type has been found for the specified path
-
getForUri
Description copied from interface:MediaTypeServiceDetermines the media type of the specified path.
- Specified by:
getForUriin interfaceMediaTypeService- Parameters:
uri- a URI- Returns:
- a media type or null if no known media type has been found for the specified URI
-