ktor-server-core / io.ktor.http.content / LocalFileContent

LocalFileContent

class LocalFileContent : ReadChannelContent

OutgoingContent representing a local file with a specified contentType, expires date and caching

Parameters

file - specifies the File to be served to a client

Constructors

<init>

LocalFileContent(file: File, contentType: ContentType = ContentType.defaultForFile(file))

OutgoingContent representing a local file with a specified contentType, expires date and caching

Properties

contentLength

val contentLength: Long

contentType

val contentType: ContentType

file

val file: File

specifies the File to be served to a client

Functions

readFrom

fun readFrom(): ByteReadChannel
fun readFrom(range: LongRange): ByteReadChannel

Extension Properties

defaultVersions

val OutgoingContent.defaultVersions: List<Version>

Retrieves LastModified and ETag versions from this OutgoingContent headers