Package-level declarations

Types

Link copied to clipboard

Stub implementation that always fails. Will be removed so no public signatures should rely on it

Link copied to clipboard
class AttributeKey<T : Any>(val name: String)

Specifies a key for an attribute in Attributes

Link copied to clipboard
interface Attributes

Map of attributes accessible by AttributeKey in a typed manner

Link copied to clipboard
Link copied to clipboard

A map with case-insensitive String keys

Link copied to clipboard
Link copied to clipboard
interface Digest

Stateful digest class specified to calculate digest.

Link copied to clipboard
interface Encoder

Content encoder.

Link copied to clipboard

A version of AttributeKey that overrides equals and hashCode using name

Link copied to clipboard

This implementation does only generate nonce values but doesn't validate them. This is recommended for testing only.

Link copied to clipboard
object Hash
Link copied to clipboard
object Identity : Encoder

Empty Encoder that doesn't do any changes.

Link copied to clipboard

API marked with this annotation is internal, and it is not intended to be used outside Ktor. It could be modified or removed without any notice. Using it outside Ktor could cause undefined behaviour and/or any unexpected effects.

Link copied to clipboard
Link copied to clipboard

API marked with this annotation is experimental and is not guaranteed to be stable.

Link copied to clipboard
interface NonceManager

Represents a nonce manager. Its responsibility is to produce nonce values and verify nonce values from untrusted sources that they are provided by this manager. This is usually required in web environment to mitigate CSRF attacks. Depending on it's underlying implementation it could be stateful or stateless. Note that there is usually some timeout for nonce values to reduce memory usage and to avoid replay attacks. Nonce length is unspecified.

Link copied to clipboard
expect object PlatformUtils
actual object PlatformUtils
actual object PlatformUtils
actual object PlatformUtils
Link copied to clipboard

API marked with this annotation is intended to become public in the future version. Usually it means that the API can't be public at the moment of development due to compatibility guarantees restrictions.

Link copied to clipboard
class StatelessHmacNonceManager(val keySpec: SecretKeySpec, val algorithm: String = "HmacSHA256", val timeoutMillis: Long = 60000, val nonceGenerator: () -> String = { generateNonce() }) : NonceManager

Stateless nonce manager implementation with HMAC verification and timeout. Every nonce provided by this manager consist of a random part, timestamp and HMAC.

Link copied to clipboard
interface StringValues

Provides data structure for associating a String with a List of Strings

Link copied to clipboard
Link copied to clipboard
open class StringValuesBuilderImpl(val caseInsensitiveName: Boolean = false, size: Int = 8) : StringValuesBuilder
Link copied to clipboard
open class StringValuesImpl(val caseInsensitiveName: Boolean = false, values: Map<String, List<String>> = emptyMap()) : StringValues
Link copied to clipboard
open class StringValuesSingleImpl(val caseInsensitiveName: Boolean, val name: String, val values: List<String>) : StringValues
Link copied to clipboard
object ThreadInfo
Link copied to clipboard
class WorkerStacktrace(val worker: String, val stacktrace: List<String>)

Functions

Link copied to clipboard

Append all values from the specified builder

Link copied to clipboard
fun StringValuesBuilder.appendFiltered(source: StringValues, keepEmpty: Boolean = false, predicate: (String, String) -> Boolean)

Append values from source filtering values by the specified predicate

Link copied to clipboard

Appends name pair if there are no values associated with name

Link copied to clipboard

Appends name pair if there is no existing name pair

Link copied to clipboard

Convert io.ktor.utils.io Input to java InputStream

Link copied to clipboard
expect fun Attributes(concurrent: Boolean = false): Attributes

Creates an attributes instance suitable for the particular platform

actual fun Attributes(concurrent: Boolean): Attributes

Create ES specific Attributes instance.

actual fun Attributes(concurrent: Boolean): Attributes

Create JVM specific attributes instance.

actual fun Attributes(concurrent: Boolean): Attributes

Create native specific attributes instance.

Link copied to clipboard
suspend fun Digest.build(bytes: ByteArray): ByteArray

Calculate digest from current state and specified bytes.

suspend fun Digest.build(string: String, charset: Charset = Charsets.UTF_8): ByteArray

Calculate digest from current state and specified string.

Link copied to clipboard

Create an instance of case-insensitive mutable map. For internal use only.

Link copied to clipboard
inline fun String.chomp(separator: String, onMissingDelimiter: () -> Pair<String, String>): Pair<String, String>

Splits the given string into two parts before and after separator.

Link copied to clipboard
fun File.combineSafe(relativePath: Path): File
fun File.combineSafe(relativePath: String): File
fun Path.combineSafe(relativePath: Path): File

Append a relativePath safely that means that adding any extra .. path elements will not let access anything out of the reference directory (unless you have symbolic or hard links or multiple mount points)

Link copied to clipboard
operator fun LongRange.contains(other: LongRange): Boolean

Returns true if other range is fully contained inside this range

Link copied to clipboard
fun ByteBuffer.copy(size: Int = remaining()): ByteBuffer

Moves all bytes in this buffer to a newly created buffer with the optionally specified size

fun ByteBuffer.copy(pool: ObjectPool<ByteBuffer>, size: Int = remaining()): ByteBuffer

Moves all bytes in this buffer to a newly created buffer with the optionally specified size by allocating it from the given pool

Link copied to clipboard

Copy source channel to both output channels chunk by chunk.

Link copied to clipboard
fun Dispatchers.createFixedThreadDispatcher(name: String, threads: Int): CloseableCoroutineDispatcher
Link copied to clipboard
fun <K, V> createLRUCache(supplier: (K) -> V, close: (V) -> Unit, maxSize: Int): Map<K, V>

Create a new instance of thread safe LRUCache and return it.

Link copied to clipboard

Decode ByteReadPacket from base64 format

Decode String from base64 format

Link copied to clipboard

Decode String from base64 format encoded in UTF-8.

Link copied to clipboard
fun ByteBuffer.decodeString(charset: Charset = Charsets.UTF_8): String

Decodes a string from this buffer with the specified charset

Link copied to clipboard
fun ByteReadChannel.deflated(gzip: Boolean = true, pool: ObjectPool<ByteBuffer> = KtorDefaultPool, coroutineContext: CoroutineContext = Dispatchers.Unconfined): ByteReadChannel
fun ByteWriteChannel.deflated(gzip: Boolean = true, pool: ObjectPool<ByteBuffer> = KtorDefaultPool, coroutineContext: CoroutineContext = Dispatchers.Unconfined): ByteWriteChannel

Launch a coroutine on coroutineContext that does deflate compression optionally doing CRC and writing GZIP header and trailer if gzip = true

Link copied to clipboard
expect fun Digest(name: String): Digest

Create Digest from specified hash name.

actual fun Digest(name: String): Digest

Create Digest from specified hash name.

actual fun Digest(name: String): Digest

Create Digest from specified hash name.

actual fun Digest(name: String): Digest

Create Digest from specified hash name.

Link copied to clipboard

Encode ByteReadPacket in base64 format

Encode ByteArray in base64 format

Encode String in base64 format and UTF-8 character encoding.

Link copied to clipboard

Escapes the characters in a String using HTML entities

Link copied to clipboard
fun StringValues.filter(keepEmpty: Boolean = false, predicate: (String, String) -> Boolean): StringValues

Create a new instance of StringValues filtered by the specified predicate

Link copied to clipboard

Copy values to a list of pairs

Link copied to clipboard

Invoke block function for every value pair

Link copied to clipboard
expect fun generateNonce(): String

Generates a nonce string. Could block if the system's entropy source is empty

Generates a nonce bytes of size. Could block if the system's entropy source is empty

actual fun generateNonce(): String

Generates a nonce string.

actual fun generateNonce(): String

Generates a nonce string 16 characters long. Could block if the system's entropy source is empty

actual fun generateNonce(): String

Generates a nonce string 32 characters long. Could block if the system's entropy source is empty

Link copied to clipboard
fun getDigestFunction(algorithm: String, salt: (value: String) -> String): (String) -> ByteArray

Create a digest function with the specified algorithm and salt provider.

Link copied to clipboard
fun hex(bytes: ByteArray): String

Encode bytes as a HEX string with no spaces, newlines and 0x prefixes.

Decode bytes from HEX string. It should be no spaces and 0x prefixes.

Link copied to clipboard

Check if Char is in lower case

Link copied to clipboard
fun ByteBuffer.moveTo(destination: ByteBuffer, limit: Int = Int.MAX_VALUE): Int

Moves bytes from this buffer to the destination buffer

Link copied to clipboard

Moves bytes from this buffer into newly created ByteArray and returns it

Link copied to clipboard

Remove all redundant . and .. path elements. Leading .. are also considered redundant.

Link copied to clipboard
fun Job.printDebugTree(offset: Int = 0)

Print Job children tree.

Link copied to clipboard

Adds all attributes from another collection, replacing original values if any.

Link copied to clipboard

Read from a NIO channel into the specified buffer Could return 0 if the channel is non-blocking or buffer has no free space

Link copied to clipboard

Read Short in network order(BE) with specified offset from ByteArray.

Link copied to clipboard
expect fun sha1(bytes: ByteArray): ByteArray

Compute SHA-1 hash for the specified bytes

actual fun sha1(bytes: ByteArray): ByteArray

Compute SHA-1 hash for the specified bytes

actual fun sha1(bytes: ByteArray): ByteArray

Compute SHA-1 hash for the specified bytes

actual fun sha1(bytes: ByteArray): ByteArray

Compute SHA-1 hash for the specified bytes

Link copied to clipboard
fun SilentSupervisor(parent: Job? = null): CoroutineContext

Supervisor with empty coroutine exception handler ignoring all exceptions.

Link copied to clipboard
fun ByteReadChannel.split(coroutineScope: CoroutineScope): Pair<ByteReadChannel, ByteReadChannel>

Split source ByteReadChannel into 2 new one. Cancel of one channel in split(input or both outputs) cancels other channels.

Link copied to clipboard

Read channel to byte array.

Link copied to clipboard
Link copied to clipboard

Does the same as the regular toLowerCase except that locale-specific rules are not applied to ASCII characters so latin characters are converted by the original english rules.

Link copied to clipboard

Copy values to a new independent map

Link copied to clipboard

Does the same as the regular toUpperCase except that locale-specific rules are not applied to ASCII characters so latin characters are converted by the original english rules.

Link copied to clipboard
expect fun <T> Set<T>.unmodifiable(): Set<T>

Freeze selected set. May do nothing on some platforms.

actual fun <T> Set<T>.unmodifiable(): Set<T>
actual fun <T> Set<T>.unmodifiable(): Set<T>

Wraps into an unmodifiable set

actual fun <T> Set<T>.unmodifiable(): Set<T>
Link copied to clipboard

Build an empty StringValues instance.

fun valuesOf(vararg pairs: Pair<String, List<String>>, caseInsensitiveKey: Boolean = false): StringValues

Build an instance of StringValues from a vararg list of pairs

fun valuesOf(map: Map<String, Iterable<String>>, caseInsensitiveKey: Boolean = false): StringValues

Build an instance of StringValues from the specified map

fun valuesOf(name: String, value: String, caseInsensitiveKey: Boolean = false): StringValues

Build an instance of StringValues from a single pair

fun valuesOf(name: String, values: List<String>, caseInsensitiveKey: Boolean = false): StringValues

Build an instance of StringValues with a single name and multiple values

Link copied to clipboard

Write bytes to a NIO channel from the specified buffer Could return 0 if the channel is non-blocking or buffer has no free space

Properties

Link copied to clipboard

Implementation of Deflate Encoder.

Link copied to clipboard

Finds an extension of the given Path

Link copied to clipboard

Implementation of GZip Encoder.

Link copied to clipboard

Length of this LongRange

Link copied to clipboard

Root cause of the Throwable.