EntityTagVersion

data class EntityTagVersion(etag: String, weak: Boolean) : Version

This version checks the etag value and pass it through conditions supplied by the remote client. Depending on the conditions, it produces the return value of enum type VersionCheckResult.

It never handles If-None-Match: * as it is related to non-etag logic (for example, Last modified checks).

Return

VersionCheckResult.OK if all headers pass or there was no related headers, VersionCheckResult.NOT_MODIFIED for successful If-None-Match, VersionCheckResult.PRECONDITION_FAILED for failed If-Match

Parameters

etag
  • entity tag, for example file's content hash

weak
  • whether strong or weak validation should be applied

Constructors

Link copied to clipboard
fun EntityTagVersion(etag: String, weak: Boolean)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun appendHeadersTo(builder: HeadersBuilder)

Appends relevant headers to the builder.

Link copied to clipboard
open override fun check(requestHeaders: Headers): VersionCheckResult

Checks requestHeaders against this version and returns VersionCheckResult.

Link copied to clipboard
fun match(other: EntityTagVersion): Boolean

Checks whether two entity-tags match (strong).

fun match(givenMatchEtags: List<EntityTagVersion>): VersionCheckResult

Specifies If-Match logic using the match function.

Link copied to clipboard
fun noneMatch(givenNoneMatchEtags: List<EntityTagVersion>): VersionCheckResult

Specifies If-None-Match logic using the match function.

Properties

Link copied to clipboard
val etag: String
Link copied to clipboard
val weak: Boolean