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

public abstract Class AbstractFileNameVersionStrategy

extends Object
implements VersionStrategy
Class Inheritance
All Implemented Interfaces
org.springframework.web.reactive.resource.VersionStrategy
Known Direct Subclasses
org.springframework.web.reactive.resource.ContentVersionStrategy
Imports
java.util.regex.Matcher, .Pattern, org.apache.commons.logging.Log, .LogFactory, org.springframework.util.StringUtils

Abstract base class for filename suffix based VersionStrategy implementations, e.g. "static/myresource-version.js"
Authors
Rossen Stoyanchev, Brian Clozel
Since
5.0

Field Summary

Modifier and TypeField and Description
protected final Log
private static final Pattern

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
addVersion(String
the requestPath
requestPath
,
String
the version
version
)

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

Add a version to the given request path.

public String
extractVersion(String
the request path to check
requestPath
)

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

Extract the resource version from the request path.

public String
removeVersion(String
the request path of the resource being resolved
requestPath
,
String
the version obtained from extractVersion(String)
version
)

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

Remove the version from the request path.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

loggerback to summary
protected final Log logger
patternback to summary
private static final Pattern pattern

Constructor Detail

AbstractFileNameVersionStrategyback to summary
public AbstractFileNameVersionStrategy()

Method Detail

addVersionback to summary
public String addVersion(String requestPath, String version)

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

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

Add a version to the given request path.

Parameters
requestPath:String

the requestPath

version:String

the version

Returns:String

the requestPath updated with a version string

Annotations
@Override
extractVersionback to summary
public String extractVersion(String requestPath)

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

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

Extract the resource version from the request path.

Parameters
requestPath:String

the request path to check

Returns:String

the version string or null if none was found

Annotations
@Override
removeVersionback to summary
public String removeVersion(String requestPath, String version)

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

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

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

Parameters
requestPath:String

the request path of the resource being resolved

version:String

the version obtained from extractVersion(String)

Returns:String

the request path with the version removed

Annotations
@Override