scoop:scoop.http.server:0.1.0
src/files/file_response_options_builder.scoop
Selected production source · src/files/file_response_options_builder.scoop
1
package scoop.http.server3
import scoop.http.*4
import scoop.platform.fs.Path5
import scoop.http.asyncio.*7
/** Configures one complete value; execution remains explicit. */8
public fun fileResponseOptions(9
configure: FileResponseOptionsBuilder.() -> Unit = {}10
): FileResponseOptions {11
val builder = FileResponseOptionsBuilder()12
builder.configure()13
return builder.snapshot()14
}16
public fun FileResponseOptions.copy(17
configure: FileResponseOptionsBuilder.() -> Unit = {}18
): FileResponseOptions {19
val builder = FileResponseOptionsBuilder()20
builder.contentType = this.contentType21
builder.entityTag = this.entityTag22
builder.contentEncoding = this.contentEncoding23
builder.lastModifiedIsStrong = this.lastModifiedIsStrong24
builder.bufferSize = this.bufferSize25
builder.configure()26
return builder.snapshot()27
}29
public class FileResponseOptionsBuilder internal constructor() {30
public var contentType: String? = None31
public var entityTag: HttpEntityTag? = None32
public var contentEncoding: String? = None33
public var lastModifiedIsStrong: Boolean = false34
public var bufferSize: Long = 8192L35
internal fun snapshot(): FileResponseOptions =36
FileResponseOptions(37
contentType,38
entityTag,39
contentEncoding,40
lastModifiedIsStrong,41
bufferSize42
)43
}