org.apache.tika.mime
Class MediaType
java.lang.Object
org.apache.tika.mime.MediaType
public final class MediaType
- extends Object
Internet media type.
OCTET_STREAM
public static final MediaType OCTET_STREAM
TEXT_PLAIN
public static final MediaType TEXT_PLAIN
APPLICATION_XML
public static final MediaType APPLICATION_XML
MediaType
public MediaType(String type,
String subtype,
Map<String,String> parameters)
MediaType
public MediaType(String type,
String subtype)
MediaType
public MediaType(MediaType type,
Map<String,String> parameters)
parse
public static MediaType parse(String string)
- Parses the given string to a media type. The string is expected to be of
the form "type/subtype(; parameter=...)*" as defined in RFC 2045, though
we also handle "charset=xxx; type/subtype" for broken web servers.
- Parameters:
string
- media type string to be parsed
- Returns:
- parsed media type, or
null
if parsing fails
getBaseType
public MediaType getBaseType()
getType
public String getType()
getSubtype
public String getSubtype()
getParameters
public Map<String,String> getParameters()
isSpecializationOf
public boolean isSpecializationOf(MediaType that)
toString
public String toString()
- Overrides:
toString
in class Object
equals
public boolean equals(Object object)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
Copyright © 2007-2010 The Apache Software Foundation. All Rights Reserved.