public final class ContentType extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ContentType.Parameter
Content type parameter, see
parameter definition in RFC 2045. |
static class |
ContentType.StandardType
Standard content types.
|
Constructor and Description |
---|
ContentType(String type,
String subtype)
Constructs a new ContentType.
|
ContentType(String type,
String subtype,
List<ContentType.Parameter> param)
Constructs a new ContentType.
|
Modifier and Type | Method and Description |
---|---|
static void |
checkToken(String t)
Checks a token syntax.
|
ContentType.Parameter |
getParameter(String attribute)
Returns the first parameter matching this attribute string.
|
List<ContentType.Parameter> |
getParameters()
Returns parameters, unmodifiable.
|
String |
getParameterValue(String attribute)
Returns the first parameter value matching this attribute string.
|
String |
getSubtype()
Returns content sub type.
|
String |
getType()
Returns type.
|
static ContentType |
parse(String string)
Factory method, parsing a content type line and generating a content type
object.
|
String |
toString() |
public ContentType(String type, String subtype, List<ContentType.Parameter> param)
type
- non-null typesubtype
- non-null subtypeparam
- list of parameters, optionally nullpublic static ContentType parse(String string)
public static void checkToken(String t)
IllegalArgumentException
- if token is invalidpublic String getType()
public String getSubtype()
public List<ContentType.Parameter> getParameters()
public ContentType.Parameter getParameter(String attribute)
public String getParameterValue(String attribute)
Copyright © 2013. All Rights Reserved.