public final class MediaTypeFactory
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.util.Optional<MediaType> |
getMediaType(Resource resource)
Determine a media type for the given resource, if possible.
|
static java.util.Optional<MediaType> |
getMediaType(java.lang.String filename)
Determine a media type for the given file name, if possible.
|
static java.util.List<MediaType> |
getMediaTypes(java.lang.String filename)
Determine the media types for the given file name, if possible.
|
public static java.util.Optional<MediaType> getMediaType(@Nullable Resource resource)
resource
- the resource to introspectnull
if none foundpublic static java.util.Optional<MediaType> getMediaType(@Nullable java.lang.String filename)
filename
- the file name plus extensionnull
if none found