class ContentType : HeaderValueWithParameters
Represents a value for a Content-Type
header.
object Application
Provides a list of standard subtypes of an |
|
object Audio
Provides a list of standard subtypes of an |
|
object Image
Provides a list of standard subtypes of an |
|
object Message
Provides a list of standard subtypes of a |
|
object MultiPart
Provides a list of standard subtypes of a |
|
object Text
Provides a list of standard subtypes of a |
|
object Video
Provides a list of standard subtypes of a |
ContentType(contentType: String, contentSubtype: String, parameters: List<HeaderValueParam> = emptyList()) |
val contentSubtype: String
represents a subtype part of the media type. |
|
val contentType: String
represents a type part of the media type. |
val content: String
header's content without parameters |
|
val parameters: List<HeaderValueParam> |
fun equals(other: Any?): Boolean |
|
fun hashCode(): Int |
|
fun match(pattern: ContentType): Boolean fun match(pattern: String): Boolean
Checks if |
|
fun withParameter(name: String, value: String): ContentType
Creates a copy of |
|
fun withoutParameters(): ContentType
Creates a copy of |
fun parameter(name: String): String?
The first value for the parameter with name comparing case-insensitively or |
|
open fun toString(): String |
val Any: ContentType
Represents a pattern |
fun parse(value: String): ContentType
Parses a string representing a |
fun HeaderValueWithParameters.charset(): <ERROR CLASS>?
Extracts a Charset value from the given |
|
fun ContentType.fileExtensions(): List<String>
Recommended file name extensions for this content type |
|
fun ContentType.withCharset(charset: <ERROR CLASS>): ContentType
Creates a copy of |
fun ContentType.Companion.defaultForFile(file: File): ContentType fun ContentType.Companion.defaultForFile(file: Path): ContentType |
|
fun ContentType.Companion.defaultForFileExtension(extension: String): ContentType
Default ContentType for extension |
|
fun ContentType.Companion.defaultForFilePath(path: String): ContentType
Default ContentType for file path |
|
fun ContentType.Companion.fromFileExtension(ext: String): List<ContentType>
Recommended content type by file name extension |
|
fun ContentType.Companion.fromFilePath(path: String): List<ContentType>
Recommended content types by file path |