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.
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)
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 not charset.
|
| 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.
|
ContentType |
copy(java.lang.String mimeType,
java.nio.charset.Charset charset)
Represents the data in a
Content-Type header; includes the MIME type and an optional charset. |
boolean |
equals(java.lang.Object p) |
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)
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.class ContentTypepublic ContentType(java.lang.String mimeType)
Creates an instance with the specified MIME type and not charset.
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 component1()
The MIME type of the content.
public java.nio.charset.Charset component2()
The charset of the content.
public ContentType copy(java.lang.String mimeType, java.nio.charset.Charset charset)
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.
class ContentTypepublic java.lang.String toString()
public int hashCode()
public boolean equals(java.lang.Object p)