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,
String charset,
String boundary)
Constructs a new header based on message type, charset and boundary.
|
ContentTypeHeader(String type,
String charset,
String boundary,
Map<String,String> additionalParameters)
Constructs a new header based on message type, charset, boundary and any additional message parameters.
|
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
getAdditionalParameters()
Returns any additional parameters in the message or an empty map if none specified.
|
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. |
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
.public ContentTypeHeader(String type, String charset, String boundary)
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.public ContentTypeHeader(String type, String charset, String boundary, Map<String,String> additionalParameters)
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 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.public Map<String,String> getAdditionalParameters()
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 © 2025 Open Identity Platform Community. All rights reserved.