WebServerDispatcher.Resource


class WebServerDispatcher.Resource


A resource served by WebServerDispatcher.

Summary

Nested types

Builder for Resource.

Constants

const Int

The server doesn't support gzip.

const Int

The server supports gzip.

const Int

The server supports gzip.

Public functions

WebServerDispatcher.Resource.Builder!

Returns a new Builder initialized with the values from this instance.

Boolean

Returns true if the resource should resolve to an unknown length.

Boolean

Returns true if RFC 7233 range requests should be supported for this resource.

Public properties

ByteArray<Byte>!
Int
String!

Constants

GZIP_SUPPORT_DISABLED

const val GZIP_SUPPORT_DISABLED = 1: Int

The server doesn't support gzip.

GZIP_SUPPORT_ENABLED

const val GZIP_SUPPORT_ENABLED = 2: Int

The server supports gzip. Responses are only compressed if the request signals "gzip" is an acceptable content-coding using an Accept-Encoding header.

GZIP_SUPPORT_FORCED

const val GZIP_SUPPORT_FORCED = 3: Int

The server supports gzip. Responses are compressed if the request contains no Accept-Encoding header or one that accepts "gzip".

RFC 2616 14.3 recommends a server use "identity" content-coding if no Accept-Encoding is present, but some servers will still compress responses in this case. This option mimics that behaviour.

Public functions

buildUpon

fun buildUpon(): WebServerDispatcher.Resource.Builder!

Returns a new Builder initialized with the values from this instance.

resolvesToUnknownLength

fun resolvesToUnknownLength(): Boolean

Returns true if the resource should resolve to an unknown length.

supportsRangeRequests

fun supportsRangeRequests(): Boolean

Returns true if RFC 7233 range requests should be supported for this resource.

Public properties

data

val dataByteArray<Byte>!

gzipSupport

val gzipSupportInt

path

val pathString!