public class ContentType
extends HeaderValueWithParameters
Represents a value for a Content-Type
header.
Modifier and Type | Class and Description |
---|---|
static class |
ContentType.Application
Provides a list of standard subtypes of an
application content type. |
static class |
ContentType.Audio
Provides a list of standard subtypes of an
audio content type. |
static class |
ContentType.Companion |
static class |
ContentType.Image
Provides a list of standard subtypes of an
image content type. |
static class |
ContentType.Message
Provides a list of standard subtypes of a
message content type. |
static class |
ContentType.MultiPart
Provides a list of standard subtypes of a
multipart content type. |
static class |
ContentType.Text
Provides a list of standard subtypes of a
text content type. |
static class |
ContentType.Video
Provides a list of standard subtypes of a
video content type. |
Modifier and Type | Field and Description |
---|---|
static ContentType.Companion |
Companion |
Constructor and Description |
---|
ContentType(java.lang.String contentType,
java.lang.String contentSubtype,
java.util.List<io.ktor.http.HeaderValueParam> parameters) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
java.lang.String |
getContentSubtype()
represents a subtype part of the media type.
|
java.lang.String |
getContentType()
represents a type part of the media type.
|
int |
hashCode() |
boolean |
match(ContentType pattern)
Checks if
this type matches a pattern type taking into account placeholder symbols * and parameters. |
boolean |
match(java.lang.String pattern)
Checks if
this type matches a pattern type taking into account placeholder symbols * and parameters. |
ContentType |
withParameter(java.lang.String name,
java.lang.String value)
Creates a copy of
this type with the added parameter with the name and value. |
ContentType |
withoutParameters()
Creates a copy of
this type without any parameters |
getContent, getParameters, parameter, toString
public static ContentType.Companion Companion
public ContentType(java.lang.String contentType, java.lang.String contentSubtype, java.util.List<io.ktor.http.HeaderValueParam> parameters)
public ContentType withParameter(java.lang.String name, java.lang.String value)
Creates a copy of this
type with the added parameter with the name and value.
public ContentType withoutParameters()
Creates a copy of this
type without any parameters
public boolean match(ContentType pattern)
Checks if this
type matches a pattern type taking into account placeholder symbols *
and parameters.
public boolean match(java.lang.String pattern)
Checks if this
type matches a pattern type taking into account placeholder symbols *
and parameters.
public boolean equals(java.lang.Object other)
public int hashCode()
public java.lang.String getContentType()
represents a type part of the media type.
public java.lang.String getContentSubtype()
represents a subtype part of the media type.