Package dev.enola.common.io.mediatype
Interface ResourceMediaTypeDetector
- All Known Subinterfaces:
MediaTypeProvider
- All Known Implementing Classes:
DatalogMediaTypes,GexfMediaType,GraphCommonsMediaType,GraphvizMediaType,HandlebarsMediaType,MarkdownMediaTypes,MediaTypeProviders,ProtobufMediaTypes,RdfMediaTypes,RdfMediaTypeYamlLd,StandardMediaTypes,TestMediaType,ThingMediaTypes,TikaMediaTypeProvider,XmlMediaType,YamlMediaType
public interface ResourceMediaTypeDetector
API for detectors of a (better) MediaType for a Resource.
This interface is typically not used directly by Resource API users (who would just
use AbstractResource.mediaType()). Instead, it is normally implemented by (some)
*MediaType API implementations.
-
Method Summary
Modifier and TypeMethodDescriptiondetect(AbstractResource resource) Deprecated.detect(String uri, ByteSource byteSource, MediaType original) Detect theMediaType.
-
Method Details
-
detect
Deprecated. -
detect
Detect theMediaType. This may look e.g. at the filename extension of the URI. It could also "sniff" the content to detect "magic numbers" of certain binary file formats in headers from byteSource; such implementations internally may useResourceCharsetDetector(which may "sniff" e.g. BOM headers).
-