|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tika.mime.MediaType
public final class MediaType
Internet media type.
Field Summary | |
---|---|
static MediaType |
APPLICATION_XML
|
static MediaType |
APPLICATION_ZIP
|
static MediaType |
OCTET_STREAM
|
static MediaType |
TEXT_PLAIN
|
Constructor Summary | |
---|---|
MediaType(MediaType type,
Map<String,String> parameters)
|
|
MediaType(String type,
String subtype)
|
|
MediaType(String type,
String subtype,
Map<String,String> parameters)
|
Method Summary | |
---|---|
static MediaType |
application(String type)
|
static MediaType |
audio(String type)
|
int |
compareTo(MediaType that)
|
boolean |
equals(Object object)
|
MediaType |
getBaseType()
Returns the base form of the MediaType, excluding any parameters, such as "text/plain" for "text/plain; charset=utf-8" |
Map<String,String> |
getParameters()
Returns an immutable sorted map of the parameters of this media type. |
String |
getSubtype()
Return the Sub-Type of the MediaType, such as "plain" for "text/plain" |
String |
getType()
Return the Type of the MediaType, such as "text" for "text/plain" |
int |
hashCode()
|
boolean |
hasParameters()
Checks whether this media type contains parameters. |
static MediaType |
image(String type)
|
static MediaType |
parse(String string)
Parses the given string to a media type. |
static MediaType |
text(String type)
|
String |
toString()
|
static MediaType |
video(String type)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final MediaType OCTET_STREAM
public static final MediaType TEXT_PLAIN
public static final MediaType APPLICATION_XML
public static final MediaType APPLICATION_ZIP
Constructor Detail |
---|
public MediaType(String type, String subtype, Map<String,String> parameters)
public MediaType(String type, String subtype)
public MediaType(MediaType type, Map<String,String> parameters)
Method Detail |
---|
public static MediaType application(String type)
public static MediaType audio(String type)
public static MediaType image(String type)
public static MediaType text(String type)
public static MediaType video(String type)
public static MediaType parse(String string)
string
- media type string to be parsed
null
if parsing failspublic MediaType getBaseType()
public String getType()
public String getSubtype()
public boolean hasParameters()
true
if this type has one or more parameters,
false
otherwisepublic Map<String,String> getParameters()
public String toString()
toString
in class Object
public boolean equals(Object object)
equals
in class Object
public int hashCode()
hashCode
in class Object
public int compareTo(MediaType that)
compareTo
in interface Comparable<MediaType>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |