Package dev.enola.common.io.mediatype
Class YamlMediaType
java.lang.Object
dev.enola.common.io.mediatype.ResourceCharsetDetectorSPI
dev.enola.common.io.mediatype.YamlMediaType
- All Implemented Interfaces:
MediaTypeProvider,ResourceCharsetDetector,ResourceMediaTypeDetector
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondetectCharset(URI uri, ByteSource source) Detect theCharsetby "sniffing" the source e.g.Maps the URI path "extension" (WITH the dot; or not, filenames such as "README" are also permitted!) to its "canonical" Media Types.Maps "canonical" (primary) Media Types to a set of its "also known as alternatives".Methods inherited from class dev.enola.common.io.mediatype.ResourceCharsetDetectorSPI
peekMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.enola.common.io.mediatype.MediaTypeProvider
detectMethods inherited from interface dev.enola.common.io.mediatype.ResourceMediaTypeDetector
detect
-
Field Details
-
YAML_UTF_8
-
-
Constructor Details
-
YamlMediaType
public YamlMediaType()
-
-
Method Details
-
knownTypesWithAlternatives
Description copied from interface:MediaTypeProviderMaps "canonical" (primary) Media Types to a set of its "also known as alternatives".- Specified by:
knownTypesWithAlternativesin interfaceMediaTypeProvider
-
extensionsToTypes
Description copied from interface:MediaTypeProviderMaps the URI path "extension" (WITH the dot; or not, filenames such as "README" are also permitted!) to its "canonical" Media Types. This should only be used for "informational" listing kind of output. To actually determine a MediaType, please useMediaTypeProvider.detect(String, ByteSource, MediaType)instead.- Specified by:
extensionsToTypesin interfaceMediaTypeProvider
-
detectCharset
Description copied from interface:ResourceCharsetDetectorDetect theCharsetby "sniffing" the source e.g. for "BOM detection". The URI argument is only uses for error messages. (It's never "accessed".)- Specified by:
detectCharsetin interfaceResourceCharsetDetector- Specified by:
detectCharsetin classResourceCharsetDetectorSPI
-