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