URIFileContent

class URIFileContent(val uri: URI, val contentType: ContentType = ContentType.defaultForFilePath(uri.path), val contentLength: Long? = null) : OutgoingContent.ReadChannelContent

Represents a content that is served from the specified uri

Constructors

Link copied to clipboard
fun URIFileContent(url: URL, contentType: ContentType = ContentType.defaultForFilePath(url.path))
Link copied to clipboard
fun URIFileContent(uri: URI, contentType: ContentType = ContentType.defaultForFilePath(uri.path), contentLength: Long? = null)

Functions

Link copied to clipboard
open fun <T : Any> getProperty(key: AttributeKey<T>): T?

Gets an extension property for this content

Link copied to clipboard
open override fun readFrom(): ByteReadChannel

Provides ByteReadChannel for the content

Provides ByteReadChannel for the given range of the content

Link copied to clipboard
open fun <T : Any> setProperty(key: AttributeKey<T>, value: T?)

Sets an extension property for this content

Link copied to clipboard
open fun trailers(): Headers?

Trailers to set when sending this content, will be ignored if request is not in HTTP2 mode

Properties

Link copied to clipboard
open override val contentLength: Long? = null

Specifies content length in bytes for this resource.

Link copied to clipboard
open override val contentType: ContentType

Specifies ContentType for this resource.

Link copied to clipboard
open val headers: Headers

Headers to set when sending this content

Link copied to clipboard

Status code to set when sending this content

Link copied to clipboard
val uri: URI

that is used as a source

Extensions

Link copied to clipboard

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

Link copied to clipboard

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