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:MediaTypeService
Determines the media type of the specified file extension.
- Specified by:
getForExtension
in 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:MediaTypeService
Determines the media type of the specified file name.
- Specified by:
getForFilename
in 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:MediaTypeService
Determines the media type of the specified path.
- Specified by:
getForPath
in 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:MediaTypeService
Determines the media type of the specified path.
- Specified by:
getForUri
in interfaceMediaTypeService
- Parameters:
uri
- a URI- Returns:
- a media type or null if no known media type has been found for the specified URI
-