public class ContentType
extends java.lang.Object
| Constructor and Description |
|---|
ContentType(MediaType mediaType,
CharacterSet characterSet)
Constructor.
|
ContentType(Representation representation)
Constructor.
|
ContentType(java.lang.String headerValue)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
CharacterSet |
getCharacterSet()
Returns the character set.
|
MediaType |
getMediaType()
Returns the media type.
|
static CharacterSet |
readCharacterSet(java.lang.String contentType)
Parses the given content type header and returns the character set.
|
static MediaType |
readMediaType(java.lang.String contentType)
Parses the given content type header and returns the media type.
|
java.lang.String |
toString() |
static java.lang.String |
writeHeader(MediaType mediaType,
CharacterSet characterSet)
Writes the HTTP "Content-Type" header.
|
static java.lang.String |
writeHeader(Representation representation)
Writes the HTTP "Content-Type" header.
|
public ContentType(MediaType mediaType, CharacterSet characterSet)
mediaType - The media type.characterSet - The character set.public ContentType(Representation representation)
representation - The representation.public ContentType(java.lang.String headerValue)
headerValue - The "Content-type" header to parse.public static CharacterSet readCharacterSet(java.lang.String contentType)
contentType - The content type header to parse.public static MediaType readMediaType(java.lang.String contentType)
contentType - The content type header to parse.public static java.lang.String writeHeader(MediaType mediaType, CharacterSet characterSet)
mediaType - The representation media type.characterSet - The representation character set.public static java.lang.String writeHeader(Representation representation)
representation - The related representation.public CharacterSet getCharacterSet()
public MediaType getMediaType()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2005-2020 Restlet.