WebServerDispatcher.Resource.Builder


class WebServerDispatcher.Resource.Builder


Builder for Resource.

Summary

Public constructors

Constructs an instance.

Public functions

WebServerDispatcher.Resource!

Builds the Resource.

WebServerDispatcher.Resource.Builder!

Sets if the server shouldn't include the resource length in header responses.

WebServerDispatcher.Resource.Builder!

Sets the data served by this resource.

WebServerDispatcher.Resource.Builder!

Sets the extra response headers that should be attached.

WebServerDispatcher.Resource.Builder!

Sets the level of gzip support for this resource.

WebServerDispatcher.Resource.Builder!

Sets the path this data should be served at.

WebServerDispatcher.Resource.Builder!

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

Public constructors

Builder

Builder()

Constructs an instance.

Public functions

build

fun build(): WebServerDispatcher.Resource!

Builds the Resource.

resolvesToUnknownLength

@CanIgnoreReturnValue
fun resolvesToUnknownLength(resolvesToUnknownLength: Boolean): WebServerDispatcher.Resource.Builder!

Sets if the server shouldn't include the resource length in header responses.

If true, responses to unbound requests won't include a Content-Length header and Content-Range headers won't include the total resource length.

Returns
WebServerDispatcher.Resource.Builder!

this builder, for convenience.

setData

@CanIgnoreReturnValue
fun setData(data: ByteArray!): WebServerDispatcher.Resource.Builder!

Sets the data served by this resource. This is required.

Returns
WebServerDispatcher.Resource.Builder!

this builder, for convenience.

setExtraResponseHeaders

@CanIgnoreReturnValue
fun setExtraResponseHeaders(extraResponseHeaders: Multimap<String!, String!>!): WebServerDispatcher.Resource.Builder!

Sets the extra response headers that should be attached.

Returns
WebServerDispatcher.Resource.Builder!

this builder, for convenience.

setGzipSupport

@CanIgnoreReturnValue
fun setGzipSupport(gzipSupport: Int): WebServerDispatcher.Resource.Builder!

Sets the level of gzip support for this resource. Defaults to GZIP_SUPPORT_DISABLED.

Returns
WebServerDispatcher.Resource.Builder!

this builder, for convenience.

setPath

@CanIgnoreReturnValue
fun setPath(path: String!): WebServerDispatcher.Resource.Builder!

Sets the path this data should be served at. This is required.

Returns
WebServerDispatcher.Resource.Builder!

this builder, for convenience.

supportsRangeRequests

@CanIgnoreReturnValue
fun supportsRangeRequests(supportsRangeRequests: Boolean): WebServerDispatcher.Resource.Builder!

Sets if RFC 7233 range requests should be supported for this resource. Defaults to false.

Returns
WebServerDispatcher.Resource.Builder!

this builder, for convenience.