Package org.restlet.engine.header
Class ContentType
java.lang.Object
org.restlet.engine.header.ContentType
Association of a media type, a character set and modifiers.
- Author:
- Jerome Louvel
-
Constructor Summary
ConstructorsConstructorDescriptionContentType(String headerValue) Constructor.ContentType(MediaType mediaType, CharacterSet characterSet) Constructor.ContentType(Representation representation) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the character set.Returns the media type.static CharacterSetreadCharacterSet(String contentType) Parses the given content type header and returns the character set.static MediaTypereadMediaType(String contentType) Parses the given content type header and returns the media type.toString()static StringwriteHeader(MediaType mediaType, CharacterSet characterSet) Writes the HTTP "Content-Type" header.static StringwriteHeader(Representation representation) Writes the HTTP "Content-Type" header.
-
Constructor Details
-
ContentType
Constructor.- Parameters:
mediaType- The media type.characterSet- The character set.
-
ContentType
Constructor.- Parameters:
representation- The representation.
-
ContentType
Constructor.- Parameters:
headerValue- The "Content-type" header to parse.
-
-
Method Details
-
readCharacterSet
Parses the given content type header and returns the character set.- Parameters:
contentType- The content type header to parse.- Returns:
- The character set.
-
readMediaType
Parses the given content type header and returns the media type.- Parameters:
contentType- The content type header to parse.- Returns:
- The media type.
-
writeHeader
Writes the HTTP "Content-Type" header.- Parameters:
mediaType- The representation media type.characterSet- The representation character set.- Returns:
- The HTTP "Content-Type" header.
-
writeHeader
Writes the HTTP "Content-Type" header.- Parameters:
representation- The related representation.- Returns:
- The HTTP "Content-Type" header.
-
getCharacterSet
Returns the character set.- Returns:
- The character set.
-
getMediaType
Returns the media type.- Returns:
- The media type.
-
toString
-