spring-framework / org.springframework.web.reactive.resource / VersionStrategy

VersionStrategy

interface VersionStrategy

A strategy to determine the version of a static resource and to apply and/or extract it from the URL path.

Author
Rossen Stoyanchev

Author
Brian Clozel

Since
5.0

See Also
VersionResourceResolver

Functions

addVersion

abstract fun addVersion(requestPath: String, version: String): String

Add a version to the given request path.

extractVersion

abstract fun extractVersion(requestPath: String): String

Extract the resource version from the request path.

getResourceVersion

abstract fun getResourceVersion(resource: Resource): Mono<String>

Determine the version for the given resource.

removeVersion

abstract fun removeVersion(requestPath: String, version: String): String

Remove the version from the request path. It is assumed that the given version was extracted via #extractVersion(String).

Inheritors

AbstractFileNameVersionStrategy

abstract class AbstractFileNameVersionStrategy : VersionStrategy

Abstract base class for filename suffix based VersionStrategy implementations, e.g. "static/myresource-version.js"