ktor-http / io.ktor.http.content / URIFileContent

URIFileContent

class URIFileContent : ReadChannelContent

Represents a content that is served from the specified uri

Constructors

<init>

URIFileContent(url: URL, contentType: ContentType = ContentType.defaultForFilePath(url.path))URIFileContent(uri: URI, contentType: ContentType = ContentType.defaultForFilePath(uri.path))

Represents a content that is served from the specified uri

Properties

contentType

val contentType: ContentType

Specifies ContentType for this resource.

uri

val uri: URI

that is used as a source

Functions

readFrom

fun readFrom(): ByteReadChannel

Provides ByteReadChannel for the content

Inherited Functions

readFrom

open fun readFrom(range: LongRange): ByteReadChannel

Provides ByteReadChannel for the given range of the content

Extension Properties

caching

var OutgoingContent.caching: CachingOptions?

Gets or sets CacheControl instance as an extension property on this content

versions

var OutgoingContent.versions: List<Version>

Gets or sets list of Version instances as an extension property on this content