open static fun getMediaType(@Nullable resource: Resource): Optional<MediaType>
Determine a media type for the given resource, if possible.
resource
- the resource to introspect
Return
the corresponding media type, or null
if none found
open static fun getMediaType(@Nullable filename: String): Optional<MediaType>
Determine a media type for the given file name, if possible.
filename
- the file name plus extension
Return
the corresponding media type, or null
if none found