Package com.hexagonkt.core.media

Media types definitions and constants for default media types.

Types

Link copied to clipboard
enum ApplicationMedia : Enum<ApplicationMedia> , MediaType

Prebuilt application media types. Only validated once at start time (not constructed each time).

Link copied to clipboard
enum AudioMedia : Enum<AudioMedia> , MediaType

Prebuilt audio media types. Only validated once at start time (not constructed each time).

Link copied to clipboard
data class CustomMedia(val group: MediaTypeGroup, val type: String) : MediaType

Create a media type (for types not included by default).

Link copied to clipboard
enum FontMedia : Enum<FontMedia> , MediaType

Prebuilt font media types. Only validated once at start time (not constructed each time).

Link copied to clipboard
enum ImageMedia : Enum<ImageMedia> , MediaType

Prebuilt image media types. Only validated once at start time (not constructed each time).

Link copied to clipboard
interface MediaType

Also known as MIME type.

Link copied to clipboard
enum MediaTypeGroup : Enum<MediaTypeGroup>
Link copied to clipboard
enum MultipartMedia : Enum<MultipartMedia> , MediaType

Prebuilt multipart media types. Only validated once at start time (not constructed each time).

Link copied to clipboard
enum TextMedia : Enum<TextMedia> , MediaType

Prebuilt text media types. Only validated once at start time (not constructed each time).

Link copied to clipboard
enum VideoMedia : Enum<VideoMedia> , MediaType

Prebuilt video media types. Only validated once at start time (not constructed each time).

Functions

Link copied to clipboard
fun mediaTypeOf(file: File): MediaType
fun mediaTypeOf(url: URL): MediaType
fun mediaTypeOf(extension: String): MediaType
Link copied to clipboard
fun mediaTypeOfOrNull(file: File): MediaType?
fun mediaTypeOfOrNull(url: URL): MediaType?
fun mediaTypeOfOrNull(extension: String): MediaType?
Link copied to clipboard
fun parseMediaType(fullType: String): MediaType

Properties

Link copied to clipboard
val defaultMediaType: MediaType
Link copied to clipboard
val mediaTypeFormat: Regex