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

public Class ContentVersionStrategy

extends AbstractFileNameVersionStrategy
Class Inheritance
Imports
reactor.core.publisher.Flux, .Mono, org.springframework.core.io.Resource, org.springframework.core.io.buffer.DataBuffer, .DataBufferUtils, .DefaultDataBufferFactory, org.springframework.util.DigestUtils, .StreamUtils

A VersionStrategy that calculates a Hex MD5 hash from the content of the resource and appends it to the file name, e.g. "styles/main-e36d2e05253c6c7085a91522ce43a0b4.css".
Authors
Rossen Stoyanchev, Brian Clozel
Since
5.0
See Also
VersionResourceResolver

Field Summary

Inherited from org.springframework.web.reactive.resource.AbstractFileNameVersionStrategy:
logger

Constructor Summary

AccessConstructor and Description
public

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.AbstractFileNameVersionStrategy:
addVersionextractVersionremoveVersion

Constructor Detail

ContentVersionStrategyback to summary
public ContentVersionStrategy()

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