Modifier and Type | Field and Description |
---|---|
static String |
NAME
The name of this header.
|
Constructor and Description |
---|
ContentTypeHeader()
Constructs a new empty header whose type, charset, and boundary are all
null . |
ContentTypeHeader(String type,
Map<String,Directive> directives)
Constructs a new header based on message type and any message directives.
|
ContentTypeHeader(String type,
String charset,
String boundary)
Deprecated.
Replaced by
ContentTypeHeader(String, Map) |
ContentTypeHeader(String type,
String charset,
String boundary,
Map<String,String> additionalParameters)
Deprecated.
Replaced by
ContentTypeHeader(String, Map) |
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
getAdditionalParameters()
Deprecated.
Replaced by
getDirectives() |
String |
getBoundary()
Returns the encapsulation boundary or
null if none specified. |
Charset |
getCharset()
Returns the character set encoding used to encode the message, or
null if no character set was specified. |
Map<String,Directive> |
getDirectives()
Returns all directives in the message, keyed off the directive name,
or an empty map if none specified.
|
String |
getName()
Returns the name of the header, as it would canonically appear within an
HTTP message.
|
String |
getType()
Returns the media type of the underlying data or
null if none
specified. |
List<String> |
getValues()
Returns the header as a list of strings.
|
static ContentTypeHeader |
valueOf(Message<?> message)
Constructs a new header, initialized from the specified message.
|
static ContentTypeHeader |
valueOf(String string)
Constructs a new header, initialized from the specified string value.
|
equals, getFirstValue, hashCode, toString
public static final String NAME
public ContentTypeHeader()
null
.@Deprecated public ContentTypeHeader(String type, String charset, String boundary)
ContentTypeHeader(String, Map)
type
- The type/sub-type of the message.charset
- The character set used in encoding the message.boundary
- The boundary value provided in multipart messages.@Deprecated public ContentTypeHeader(String type, String charset, String boundary, Map<String,String> additionalParameters)
ContentTypeHeader(String, Map)
type
- The type/sub-type of the message.charset
- The character set used in encoding the message.boundary
- The boundary value provided in multipart messages.additionalParameters
- Any additional parameters provided in the message or an empty map if there are none.public ContentTypeHeader(String type, Map<String,Directive> directives)
type
- The type/sub-type of the message.directives
- Any directives provided in the message or an empty map if there are none.public static ContentTypeHeader valueOf(Message<?> message)
message
- The message to initialize the header from.public static ContentTypeHeader valueOf(String string)
string
- The value to initialize the header from.public String getType()
null
if none
specified.null
if none
specified.public Charset getCharset()
null
if no character set was specified.null
if empty.IllegalCharsetNameException
- if the given charset name is illegal.UnsupportedCharsetException
- if no support for the named charset is available.public String getBoundary()
null
if none specified.null
if none specified.@Deprecated public Map<String,String> getAdditionalParameters()
getDirectives()
public Map<String,Directive> getDirectives()
public String getName()
Header
public List<String> getValues()
Header
String
should represent the value component of the key-value
pair that makes up the HTTP header - as such, for some Header
implementations each String in this List
may contain multiple
token-separated values.
The List
returned from this method should not be expected to be
mutable. However, some subclasses of Header
may choose to
implement it as such.
Copyright 2011-2017 ForgeRock AS.