Package org.apache.tika.mime
Class MediaType
java.lang.Object
org.apache.tika.mime.MediaType
- All Implemented Interfaces:
Serializable,Comparable<MediaType>
@Deprecated(since="2026-04-30")
public final class MediaType
extends Object
implements Comparable<MediaType>, Serializable
Deprecated.
This version of the Apache Tika library is deprecated. Use your own version of Apache Tika.
Internet media type.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Deprecated.Deprecated.Creates a media type by adding a parameter to a base type.Deprecated.Creates a media type by adding the "charset" parameter to a base type.Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic MediaTypeapplication(String type) Deprecated.static MediaTypeDeprecated.intDeprecated.booleanDeprecated.Deprecated.Returns the base form of the MediaType, excluding any parameters, such as "text/plain" for "text/plain; charset=utf-8"Deprecated.Returns an immutable sorted map of the parameters of this media type.Deprecated.Return the Sub-Type of the MediaType, such as "plain" for "text/plain"getType()Deprecated.Return the Type of the MediaType, such as "text" for "text/plain"inthashCode()Deprecated.booleanDeprecated.Checks whether this media type contains parameters.static MediaTypeDeprecated.static MediaTypeDeprecated.Parses the given string to a media type.Deprecated.Convenience method that parses the given media type strings and returns an unmodifiable set that contains all the parsed types.Deprecated.Convenience method that returns an unmodifiable set that contains all the given media types.static MediaTypeDeprecated.toString()Deprecated.static MediaTypeDeprecated.
-
Field Details
-
OCTET_STREAM
Deprecated. -
EMPTY
Deprecated. -
TEXT_PLAIN
Deprecated. -
TEXT_HTML
Deprecated. -
APPLICATION_XML
Deprecated. -
APPLICATION_ZIP
Deprecated.
-
-
Constructor Details
-
MediaType
Deprecated. -
MediaType
Deprecated. -
MediaType
Deprecated. -
MediaType
Deprecated.Creates a media type by adding a parameter to a base type.- Parameters:
type- base typename- parameter namevalue- parameter value- Since:
- Apache Tika 1.2
-
MediaType
Deprecated.Creates a media type by adding the "charset" parameter to a base type.- Parameters:
type- base typecharset- charset value- Since:
- Apache Tika 1.2
-
-
Method Details
-
application
Deprecated. -
audio
Deprecated. -
image
Deprecated. -
text
Deprecated. -
video
Deprecated. -
set
Deprecated.Convenience method that returns an unmodifiable set that contains all the given media types.- Parameters:
types- media types- Returns:
- unmodifiable set of the given types
- Since:
- Apache Tika 1.2
-
set
Deprecated.Convenience method that parses the given media type strings and returns an unmodifiable set that contains all the parsed types.- Parameters:
types- media type strings- Returns:
- unmodifiable set of the parsed types
- Since:
- Apache Tika 1.2
-
parse
Deprecated.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
nullif parsing fails
-
getBaseType
Deprecated.Returns the base form of the MediaType, excluding any parameters, such as "text/plain" for "text/plain; charset=utf-8" -
getType
Deprecated.Return the Type of the MediaType, such as "text" for "text/plain" -
getSubtype
Deprecated.Return the Sub-Type of the MediaType, such as "plain" for "text/plain" -
hasParameters
public boolean hasParameters()Deprecated.Checks whether this media type contains parameters.- Returns:
trueif this type has one or more parameters,falseotherwise- Since:
- Apache Tika 0.8
-
getParameters
Deprecated.Returns an immutable sorted map of the parameters of this media type. The parameter names are guaranteed to be trimmed and in lower case.- Returns:
- sorted map of parameters
-
toString
Deprecated. -
equals
Deprecated. -
hashCode
public int hashCode()Deprecated. -
compareTo
Deprecated.- Specified by:
compareToin interfaceComparable<MediaType>
-