public class ContentType
Represents the data in a Content-Type header; includes the MIME type and an optional charset.
The parse function parses a Content-Type header and creates a class ContentType instance.
parse,
class ContentType| Modifier and Type | Class and Description |
|---|---|
static class |
ContentType.Companion |
| Modifier and Type | Field and Description |
|---|---|
static ContentType.Companion |
Companion |
| Constructor and Description |
|---|
ContentType(java.lang.String mimeType,
java.nio.charset.Charset charset,
java.lang.String boundary)
Represents the data in a
Content-Type header; includes the MIME type and an optional charset. |
ContentType(java.lang.String mimeType)
Creates an instance with the specified MIME type and no charset or boundary.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
component1()
The MIME type of the content.
|
java.nio.charset.Charset |
component2()
The charset of the content.
|
java.lang.String |
component3()
The boundary between fields in
|
ContentType |
copy(java.lang.String mimeType,
java.nio.charset.Charset charset,
java.lang.String boundary)
Represents the data in a
Content-Type header; includes the MIME type and an optional charset. |
boolean |
equals(java.lang.Object p) |
java.lang.String |
getBoundary()
The boundary between fields in
|
java.nio.charset.Charset |
getCharset()
The charset of the content.
|
java.lang.String |
getHeader()
The string representation of this content type used in a
Content-Type header. |
java.lang.String |
getMimeType()
The MIME type of the content.
|
int |
hashCode() |
java.lang.String |
toString() |
public static ContentType.Companion Companion
public ContentType(java.lang.String mimeType,
java.nio.charset.Charset charset,
java.lang.String boundary)
Represents the data in a Content-Type header; includes the MIME type and an optional charset.
The parse function parses a Content-Type header and creates a class ContentType instance.
mimeType - The MIME type of the content.charset - The charset of the content.boundary - The boundary between fields in multipart/form-data.parse,
class ContentTypepublic ContentType(java.lang.String mimeType)
Creates an instance with the specified MIME type and no charset or boundary.
public java.lang.String getHeader()
The string representation of this content type used in a Content-Type header.
public java.lang.String getMimeType()
The MIME type of the content.
public java.nio.charset.Charset getCharset()
The charset of the content.
public java.lang.String getBoundary()
The boundary between fields in
multipart/form-data.
public java.lang.String component1()
The MIME type of the content.
public java.nio.charset.Charset component2()
The charset of the content.
public java.lang.String component3()
The boundary between fields in
multipart/form-data.
public ContentType copy(java.lang.String mimeType, java.nio.charset.Charset charset, java.lang.String boundary)
Represents the data in a Content-Type header; includes the MIME type and an optional charset.
The parse function parses a Content-Type header and creates a class ContentType instance.
parse,
class ContentTypepublic java.lang.String toString()
public int hashCode()
public boolean equals(java.lang.Object p)