public class MediaTypeRegistry
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
MediaTypeRegistry() |
Modifier and Type | Method and Description |
---|---|
void |
addAlias(MediaType type,
MediaType alias) |
void |
addSuperType(MediaType type,
MediaType supertype) |
void |
addType(MediaType type) |
java.util.SortedSet<MediaType> |
getAliases(MediaType type)
Returns the set of known aliases of the given canonical media type.
|
java.util.SortedSet<MediaType> |
getChildTypes(MediaType type)
Returns the set of known children of the given canonical media type
|
static MediaTypeRegistry |
getDefaultRegistry()
Returns the built-in media type registry included in Tika.
|
MediaType |
getSupertype(MediaType type)
Returns the supertype of the given type.
|
java.util.SortedSet<MediaType> |
getTypes()
Returns the set of all known canonical media types.
|
boolean |
isInstanceOf(MediaType a,
MediaType b)
Checks whether the given media type equals the given base type or
is a specialization of it.
|
boolean |
isInstanceOf(java.lang.String a,
MediaType b)
Parses and normalises the given media type string and checks whether
the result equals the given base type or is a specialization of it.
|
boolean |
isSpecializationOf(MediaType a,
MediaType b)
Checks whether the given media type a is a specialization of a more
generic type b.
|
MediaType |
normalize(MediaType type) |
public static MediaTypeRegistry getDefaultRegistry()
public java.util.SortedSet<MediaType> getTypes()
public java.util.SortedSet<MediaType> getAliases(MediaType type)
type
- canonical media typepublic java.util.SortedSet<MediaType> getChildTypes(MediaType type)
type
- canonical media typepublic void addType(MediaType type)
public boolean isSpecializationOf(MediaType a, MediaType b)
a
- media type, normalisedb
- suspected supertype, normalisedtrue
if b is a supertype of a,
false
otherwisepublic boolean isInstanceOf(MediaType a, MediaType b)
a
- media type, normalisedb
- base type, normalisedtrue
if b equals a or is a specialization of it,
false
otherwisepublic boolean isInstanceOf(java.lang.String a, MediaType b)
a
- media typeb
- base type, normalisedtrue
if b equals a or is a specialization of it,
false
otherwisepublic MediaType getSupertype(MediaType type)
null
.type
- media typenull
for application/octet-streamCopyright © 2010 - 2020 Adobe. All Rights Reserved