Class AbstractPrefixVersionStrategy
java.lang.Object
org.springframework.web.reactive.resource.AbstractPrefixVersionStrategy
- All Implemented Interfaces:
VersionStrategy
- Direct Known Subclasses:
FixedVersionStrategy
Abstract base class for
VersionStrategy implementations that insert
a prefix into the URL path, e.g. "version/static/myresource.js".- Since:
- 5.0
- Author:
- Rossen Stoyanchev, Brian Clozel
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddVersion(String path, String version) Add a version to the given request path.extractVersion(String requestPath) Extract the resource version from the request path.removeVersion(String requestPath, String version) Remove the version from the request path.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.reactive.resource.VersionStrategy
getResourceVersion
-
Field Details
-
logger
-
-
Constructor Details
-
AbstractPrefixVersionStrategy
-
-
Method Details
-
extractVersion
Description copied from interface:VersionStrategyExtract the resource version from the request path.- Specified by:
extractVersionin interfaceVersionStrategy- Parameters:
requestPath- the request path to check- Returns:
- the version string or
nullif none was found
-
removeVersion
Description copied from interface:VersionStrategyRemove the version from the request path. It is assumed that the given version was extracted viaVersionStrategy.extractVersion(String).- Specified by:
removeVersionin interfaceVersionStrategy- Parameters:
requestPath- the request path of the resource being resolvedversion- the version obtained fromVersionStrategy.extractVersion(String)- Returns:
- the request path with the version removed
-
addVersion
Description copied from interface:VersionStrategyAdd a version to the given request path.- Specified by:
addVersionin interfaceVersionStrategy- Parameters:
path- the requestPathversion- the version- Returns:
- the requestPath updated with a version string
-