Top Description Fields Constructors Methods
org.springframework.web.reactive.resource

public Class FixedVersionStrategy

extends AbstractPrefixVersionStrategy
Class Inheritance
Imports
reactor.core.publisher.Mono, org.springframework.core.io.Resource

A VersionStrategy that relies on a fixed version applied as a request path prefix, e.g. reduced SHA, version name, release date, etc.

This is useful for example when ContentVersionStrategy cannot be used such as when using JavaScript module loaders which are in charge of loading the JavaScript resources and need to know their relative paths.

Authors
Rossen Stoyanchev, Brian Clozel
Since
5.0
See Also
VersionResourceResolver

Field Summary

Modifier and TypeField and Description
private final Mono<String>
Inherited from org.springframework.web.reactive.resource.AbstractPrefixVersionStrategy:
logger

Constructor Summary

AccessConstructor and Description
public
FixedVersionStrategy(String
the fixed version string to use
version
)

Create a new FixedVersionStrategy with the given version string.

Method Summary

Modifier and TypeMethod and Description
public Mono<String>
getResourceVersion(Resource
the resource to check
resource
)

Implements org.springframework.web.reactive.resource.VersionStrategy.getResourceVersion.

Determine the version for the given resource.

Inherited from org.springframework.web.reactive.resource.AbstractPrefixVersionStrategy:
addVersionextractVersionremoveVersion

Field Detail

versionMonoback to summary
private final Mono<String> versionMono

Constructor Detail

FixedVersionStrategyback to summary
public FixedVersionStrategy(String version)

Create a new FixedVersionStrategy with the given version string.

Parameters
version:String

the fixed version string to use

Method Detail

getResourceVersionback to summary
public Mono<String> getResourceVersion(Resource resource)

Implements org.springframework.web.reactive.resource.VersionStrategy.getResourceVersion.

Doc from org.springframework.web.reactive.resource.VersionStrategy.getResourceVersion.

Determine the version for the given resource.

Parameters
resource:Resource

the resource to check

Returns:Mono<String>

the resource version

Annotations
@Override