Class MediaType
- java.lang.Object
-
- org.apache.tomcat.util.http.parser.MediaType
-
public class MediaType extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MediaType(java.lang.String type, java.lang.String subtype, java.util.LinkedHashMap<java.lang.String,java.lang.String> parameters)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getCharset()
int
getParameterCount()
java.lang.String
getParameterValue(java.lang.String parameter)
java.lang.String
getSubtype()
java.lang.String
getType()
static MediaType
parseMediaType(java.io.StringReader input)
Parses a MediaType value, either from an HTTP header or from an application.java.lang.String
toString()
java.lang.String
toStringNoCharset()
-
-
-
Method Detail
-
getType
public java.lang.String getType()
-
getSubtype
public java.lang.String getSubtype()
-
getCharset
public java.lang.String getCharset()
-
getParameterCount
public int getParameterCount()
-
getParameterValue
public java.lang.String getParameterValue(java.lang.String parameter)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toStringNoCharset
public java.lang.String toStringNoCharset()
-
parseMediaType
public static MediaType parseMediaType(java.io.StringReader input) throws java.io.IOException
Parses a MediaType value, either from an HTTP header or from an application.- Parameters:
input
- a reader over the header text- Returns:
- a MediaType parsed from the input, or null if not valid
- Throws:
java.io.IOException
- if there was a problem reading the input
-
-