FormatHints

data class FormatHints(val mediaTypes: List<MediaType> = emptyList(), val fileExtensions: List<FileExtension> = emptyList())

Bundle of media type and file extension hints for the FormatHintsSniffer.

Constructors

Link copied to clipboard
constructor(mediaTypes: List<MediaType> = emptyList(), fileExtensions: List<FileExtension> = emptyList())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Finds the first Charset declared in the media types' charset parameter.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun addFileExtension(fileExtension: String?): FormatHints

Returns a new FormatHints after appending the given fileExtension hint.

Link copied to clipboard
fun hasFileExtension(vararg fileExtensions: String): Boolean

Returns whether this context has any of the given file extensions, ignoring case.

Link copied to clipboard
fun hasMediaType(vararg mediaTypes: String): Boolean

Returns whether this context has any of the given media type, ignoring case and extra parameters.

Link copied to clipboard
operator fun plus(other: FormatHints): FormatHints