NIST SIP Parser and Stack (v1.2) API

gov.nist.javax.sip.header
Class ContentType

java.lang.Object
  |
  +--gov.nist.core.GenericObject
        |
        +--gov.nist.javax.sip.header.SIPObject
              |
              +--gov.nist.javax.sip.header.SIPHeader
                    |
                    +--gov.nist.javax.sip.header.ParametersHeader
                          |
                          +--gov.nist.javax.sip.header.ContentType
All Implemented Interfaces:
Cloneable, ContentTypeHeader, Header, MediaType, Parameters, Serializable, SIPHeaderNames

public class ContentType
extends ParametersHeader
implements ContentTypeHeader

ContentType SIP Header

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
 

Version:
JAIN-SIP-1.1
Author:
M. Ranganathan
, Olivier Deruelle
This code is in the public domain.
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface javax.sip.header.ContentTypeHeader
NAME
 
Fields inherited from interface gov.nist.javax.sip.header.SIPHeaderNames
ACCEPT, 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, MAX_FORWARDS, MIME_VERSION, MIN_EXPIRES, ORGANIZATION, PRIORITY, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, PROXY_REQUIRE, RACK, REASON, RECORD_ROUTE, REPLY_TO, REQUIRE, RETRY_AFTER, ROUTE, RSEQ, SERVER, SUBJECT, SUBSCRIPTION_STATE, SUPPORTED, TIMESTAMP, TO, UNSUPPORTED, USER_AGENT, VIA, WARNING, WWW_AUTHENTICATE
 
Constructor Summary
ContentType()
          Default constructor.
ContentType(String contentType, String contentSubtype)
          Constructor given a content type and subtype.
 
Method Summary
 int compareMediaRange(String media)
          compare two MediaRange headers.
 String encodeBody()
          Encode into a canonical string.
 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
 
Methods inherited from class gov.nist.javax.sip.header.ParametersHeader
getParameter, getParameterNames, getParameters, getParameterValue, hasParameter, hasParameters, removeParameter, removeParameters, setParameter, setParameter, setParameters, setQuotedParameter
 
Methods inherited from class gov.nist.javax.sip.header.SIPHeader
encode, getHeaderName, getHeaderValue, getName, getValue, isHeaderList, setHeaderName
 
Methods inherited from class gov.nist.javax.sip.header.SIPObject
clone, dbgPrint, debugDump, debugDump, equals, match, merge, replace, replace, replace, replace, toString
 
Methods inherited from class gov.nist.core.GenericObject
getClassFromName, getMatcher, isMySubclass, setMatcher
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.sip.header.Parameters
getParameter, getParameterNames, removeParameter, setParameter
 
Methods inherited from interface javax.sip.header.Header
clone, equals, getName, toString
 

Constructor Detail

ContentType

public ContentType()
Default constructor.


ContentType

public ContentType(String contentType,
                   String contentSubtype)
Constructor given a content type and subtype.

Parameters:
contentType - is the content type.
contentSubtype - is the content subtype
Method Detail

compareMediaRange

public int compareMediaRange(String media)
compare two MediaRange headers.

Parameters:
media - String to set
Returns:
int.

encodeBody

public String encodeBody()
Encode into a canonical string.

Overrides:
encodeBody in class ParametersHeader
Returns:
String.

getMediaRange

public MediaRange getMediaRange()
get the mediaRange field.

Returns:
MediaRange.

getMediaType

public String getMediaType()
get the Media Type.

Returns:
String.

getMediaSubType

public String getMediaSubType()
get the MediaSubType field.

Returns:
String.

getContentSubType

public String getContentSubType()
Get the content subtype.

Specified by:
getContentSubType in interface MediaType
Returns:
the content subtype string (or null if not set).

getContentType

public String getContentType()
Get the content subtype.

Specified by:
getContentType in interface MediaType
Returns:
the content tyep string (or null if not set).

getCharset

public String getCharset()
Get the charset parameter.


setMediaRange

public void setMediaRange(MediaRange m)
Set the mediaRange member

Parameters:
m - mediaRange field.

setContentType

public void setContentType(String contentType,
                           String contentSubType)
set the content type and subtype.

Parameters:
contentType - Content type string.
contentSubType - content subtype string

setContentType

public void setContentType(String contentType)
                    throws ParseException
set the content type.

Specified by:
setContentType in interface MediaType
Parameters:
contentType - Content type string.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the contentType value.

setContentSubType

public void setContentSubType(String contentType)
                       throws ParseException
Set the content subtype.

Specified by:
setContentSubType in interface MediaType
Parameters:
contentType - String to set
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the contentSubType value.

NIST SIP Parser and Stack (v1.2) API

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Get the latest distribution.
Submit a bug report or feature request.