public class ContentType extends ParametersHeader implements ContentTypeHeader
14.17 Content-Type
The Content-Type entity-header field indicates the media type of the
entity-body sent to the recipient or, in the case of the HEAD method,
the media type that would have been sent had the request been a GET.
Content-Type = "Content-Type" ":" media-type
Media types are defined in section 3.7. An example of the field is
Content-Type: text/html; charset=ISO-8859-4
Further discussion of methods for identifying the media type of an
entity is provided in section 7.2.1.
From HTTP RFC 2616
| Modifier and Type | Field and Description |
|---|---|
protected MediaRange |
mediaRange
mediaRange field.
|
duplicates, parametersheaderNameAND, AT, COLON, COMMA, DOT, DOUBLE_QUOTE, EQUALS, GREATER_THAN, HT, immutableClasses, indentation, LESS_THAN, LPAREN, matchExpression, NEWLINE, PERCENT, POUND, QUESTION, QUOTE, RETURN, RPAREN, SEMICOLON, SLASH, SP, STAR, stringRepresentationNAMEACCEPT, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ALERT_INFO, ALLOW, ALLOW_EVENTS, AUTHENTICATION_INFO, AUTHORIZATION, CALL_ID, CALL_INFO, CONTACT, CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_TYPE, CSEQ, DATE, ERROR_INFO, EVENT, EXPIRES, FROM, IN_REPLY_TO, JOIN, MAX_FORWARDS, MIME_VERSION, MIN_EXPIRES, MIN_SE, ORGANIZATION, PRIORITY, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, PROXY_REQUIRE, RACK, REASON, RECORD_ROUTE, REFERRED_BY, REPLACES, REPLY_TO, REQUIRE, RETRY_AFTER, ROUTE, RSEQ, SERVER, SESSION_EXPIRES, SIP_ETAG, SIP_IF_MATCH, SUBJECT, SUBSCRIPTION_STATE, SUPPORTED, TIMESTAMP, TO, UNSUPPORTED, USER_AGENT, VIA, WARNING, WWW_AUTHENTICATE| Constructor and Description |
|---|
ContentType()
Default constructor.
|
ContentType(String contentType,
String contentSubtype)
Constructor given a content type and subtype.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Clones this object.
|
int |
compareMediaRange(String media)
compare two MediaRange headers.
|
String |
encodeBody()
Encode into a canonical string.
|
protected StringBuilder |
encodeBody(StringBuilder buffer)
Encode the body of this header (the stuff that follows headerName).
|
boolean |
equals(Object other)
An introspection based equality predicate for SIPObjects.
|
String |
getCharset()
Get the charset parameter.
|
String |
getContentSubType()
Get the content subtype.
|
String |
getContentType()
Get the content subtype.
|
MediaRange |
getMediaRange()
get the mediaRange field.
|
String |
getMediaSubType()
get the MediaSubType field.
|
String |
getMediaType()
get the Media Type.
|
void |
setContentSubType(String contentType)
Set the content subtype.
|
void |
setContentType(String contentType)
set the content type.
|
void |
setContentType(String contentType,
String contentSubType)
set the content type and subtype.
|
void |
setMediaRange(MediaRange m)
Set the mediaRange member
|
equalParameters, getMultiParameter, getMultiParameterNames, getMultiParameters, getMultiParameterValue, getNameValue, getParameter, getParameter, getParameterAsBoolean, getParameterAsFloat, getParameterAsHexInt, getParameterAsInt, getParameterAsLong, getParameterAsURI, getParameterNames, getParameters, getParameterValue, hasMultiParameter, hasMultiParameters, hasParameter, hasParameters, removeMultiParameter, removeMultiParameters, removeParameter, removeParameters, setMultiParameter, setMultiParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameters, setQuotedParameterencode, encode, getHeaderName, getHeaderValue, getName, getValue, hashCode, isHeaderList, setHeaderName, toStringdbgPrint, debugDump, debugDump, matchdbgPrint, getClassFromName, getIndentation, getMatcher, isMySubclass, makeClone, merge, setMatcher, sprint, sprint, sprint, sprint, sprint, sprint, sprint, sprint, sprintfinalize, getClass, notify, notifyAll, wait, wait, waitgetParameter, getParameterNames, removeParameter, setParameterprotected MediaRange mediaRange
public int compareMediaRange(String media)
media - String to setpublic String encodeBody()
protected StringBuilder encodeBody(StringBuilder buffer)
SIPHeaderencodeBody in class ParametersHeaderpublic MediaRange getMediaRange()
public String getMediaType()
public String getMediaSubType()
public String getContentSubType()
getContentSubType in interface MediaTypepublic String getContentType()
getContentType in interface MediaTypepublic String getCharset()
public void setMediaRange(MediaRange m)
m - mediaRange field.public void setContentType(String contentType, String contentSubType)
contentType - Content type string.contentSubType - content subtype stringpublic void setContentType(String contentType) throws ParseException
setContentType in interface MediaTypecontentType - Content type string.ParseException - which signals that an error has been reached
unexpectedly while parsing the contentType value.public void setContentSubType(String contentType) throws ParseException
setContentSubType in interface MediaTypecontentType - String to setParseException - which signals that an error has been reached
unexpectedly while parsing the contentSubType value.public Object clone()
GenericObjectclone in interface Headerclone in class ParametersHeaderCopyright © 2018. All Rights Reserved.