JarFileContent

class JarFileContent : ReadChannelContent

Represents an OutgoingContent for a resource inside a Jar file

Parameters

jarFile - is an instance of File representing a Jar

resourcePath - is an instance of a resource inside a Jar file

Constructors

<init>

JarFileContent(
    zipFilePath: Path,
    resourcePath: String,
    contentType: ContentType)
JarFileContent(
    jarFile: File,
    resourcePath: String,
    contentType: ContentType)

Represents an OutgoingContent for a resource inside a Jar file

Properties

contentLength

val contentLength: Long?

Specifies content length in bytes for this resource.

contentType

val contentType: ContentType

Specifies ContentType for this resource.

jarFile

val jarFile: File

is an instance of File representing a Jar

resourcePath

val resourcePath: String

is an instance of a resource inside a Jar file

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

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

defaultVersions

val OutgoingContent.defaultVersions: List<Version>

Retrieves LastModified and ETag versions from this OutgoingContent headers

versions

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

Extension Functions

toByteArray

suspend fun OutgoingContent.toByteArray(): ByteArray

toByteReadPacket

suspend fun OutgoingContent.toByteReadPacket(): ByteReadPacket

wrapHeaders

fun OutgoingContent.wrapHeaders(
    block: (Headers) -> Headers
): OutgoingContent

Generates a new OutgoingContent of the same abstract type but with OutgoingContent.headers transformed by the specified block.