Package io.ktor.util

Types

Link copied to clipboard
interface ConversionService

Data conversion service that does serialization and deserialization to/from list of strings

Link copied to clipboard
class CopyOnWriteHashMap<K : Any, V : Any>

This is an internal implementation for copy-on-write concurrent map. It is very limited since it is not intended as general purpose implementation.

Link copied to clipboard
class DataConversionException(message: String) : DataConversionException

Thrown when failed to convert value

Link copied to clipboard
object DefaultConversionService : ConversionService

The default conversion service that supports only basic types and enums

Link copied to clipboard
class DispatcherWithShutdown(delegate: CoroutineDispatcher) : CoroutineDispatcher

Specialized dispatcher useful for graceful shutdown

Functions

Link copied to clipboard
fun URLBuilder.Companion.createFromCall(call: ApplicationCall): URLBuilder

Creates an url using current call's schema, path and parameters as initial

Link copied to clipboard
inline fun Parameters.getOrFail(name: String): String

Get parameters value associated with this name or fail with MissingRequestParameterException

inline fun <R : Any> Parameters.getOrFail(name: String): R

Get parameters value associated with this name converting to type R using DefaultConversionService or fail with MissingRequestParameterException

Link copied to clipboard
inline operator fun <R : Any> Parameters.getValue(thisRef: Any?, property: KProperty<*>): R

Operator function that allows to delegate variables by call parameters. It does conversion to type R using DefaultConversionService

Link copied to clipboard
fun List<String>.normalizePathComponents(): List<String>

Process path components such as . and .., replacing redundant path components including all leading. It also discards all reserved characters and component names that are reserved (such as CON, NUL).

Link copied to clipboard
fun Date.toLocalDateTime(): LocalDateTime

Creates LocalDateTime from this Date

Link copied to clipboard
fun Date.toZonedDateTime(): ZonedDateTime

Creates ZonedDateTime from this Date

Link copied to clipboard
fun url(block: URLBuilder.() -> Unit): String

Construct a URL

inline fun ApplicationCall.url(block: URLBuilder.() -> Unit = {}): String

Creates an url using current call's schema, path and parameters as initial and then invokes block function on the url builder so amend parameters

Properties

Link copied to clipboard
val GreenwichMeanTime: ZoneId

ZoneId for GMT