public final class ContentType extends Object
Constructor and Description |
---|
ContentType()
Creates a new empty content type.
|
ContentType(String contentType)
Creates a new content type from the argument.
|
ContentType(String contentType,
String charset)
Creates a new content type with the given MIME type and charset
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Returns true only if the other object is another instance of ContentType, and has the same baseType, subType and
set of parameters.
|
String |
getBaseType() |
String |
getCharset() |
String |
getMimeType() |
String |
getParameter(String key) |
List<String> |
getParameterNames() |
String |
getSubType() |
void |
parse(String contentType)
Parses the argument and configures the content type accordingly.
|
void |
setBaseType(String baseType) |
void |
setParameter(String key,
String value) |
void |
setSubType(String subType) |
String |
toString() |
String |
unparse() |
public ContentType()
public ContentType(String contentType)
contentType
- the content type that needs to be representedpublic ContentType(String contentType, String charset)
public boolean equals(Object o)
public String getBaseType()
public void setBaseType(String baseType)
baseType
- public String getSubType()
public void setSubType(String subType)
subType
- public String getMimeType()
public List<String> getParameterNames()
public String getCharset()
public String getParameter(String key)
key
- the name of the content type parameterpublic void setParameter(String key, String value)
key
- the name of the content type parametervalue
- the value of the content type parameterpublic void parse(String contentType)
contentType
- the content type that needs to be representedCopyright © 2003-2013 The Apache Software Foundation.