Top Fields Constructors Methods
org.apache.tomcat.util.http.parser

public Class MediaType

extends Object
Class Inheritance
Imports
java.io.IOException, .StringReader, java.util.LinkedHashMap, .Locale, .Map

Field Summary

Modifier and TypeField and Description
private final String
private volatile String
private final LinkedHashMap<String, String>
private final String
private final String
private volatile String

Constructor Summary

AccessConstructor and Description
protected
MediaType(String type, String subtype, LinkedHashMap<String, String> parameters)

Method Summary

Modifier and TypeMethod and Description
public String
public int
public String
public String
public String
public static MediaType

Returns:

a MediaType parsed from the input, or null if not valid
parseMediaType
(StringReader
a reader over the header text
input
)

Parses a MediaType value, either from an HTTP header or from an application.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

charsetback to summary
private final String charset
noCharsetback to summary
private volatile String noCharset
parametersback to summary
private final LinkedHashMap<String, String> parameters
subtypeback to summary
private final String subtype
typeback to summary
private final String type
withCharsetback to summary
private volatile String withCharset

Constructor Detail

MediaTypeback to summary
protected MediaType(String type, String subtype, LinkedHashMap<String, String> parameters)

Method Detail

getCharsetback to summary
public String getCharset()
getParameterCountback to summary
public int getParameterCount()
getParameterValueback to summary
public String getParameterValue(String parameter)
getSubtypeback to summary
public String getSubtype()
getTypeback to summary
public String getType()
parseMediaTypeback to summary
public static MediaType parseMediaType(StringReader input) throws IOException

Parses a MediaType value, either from an HTTP header or from an application.

Parameters
input:StringReader

a reader over the header text

Returns:MediaType

a MediaType parsed from the input, or null if not valid

Exceptions
IOException:
if there was a problem reading the input
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
toStringNoCharsetback to summary
public String toStringNoCharset()