public class MediaTypeRegistry extends Object implements 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) |
SortedSet<MediaType> |
getAliases(MediaType type)
Returns the set of known aliases of the given canonical media type.
|
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.
|
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(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 SortedSet<MediaType> getTypes()
public SortedSet<MediaType> getAliases(MediaType type)
type
- canonical media typepublic 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(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 © 2007–2016 The Apache Software Foundation. All rights reserved.