Interface VersionStrategy
- All Known Implementing Classes:
AbstractFileNameVersionStrategy
,AbstractPrefixVersionStrategy
,ContentVersionStrategy
,FixedVersionStrategy
public interface VersionStrategy
A strategy to determine the version of a static resource and to apply and/or extract it from the URL path.- Since:
- 5.0
- Author:
- Rossen Stoyanchev, Brian Clozel
- See Also:
VersionResourceResolver
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
addVersion(String requestPath, String version)
Add a version to the given request path.String
extractVersion(String requestPath)
Extract the resource version from the request path.reactor.core.publisher.Mono<String>
getResourceVersion(Resource resource)
Determine the version for the given resource.String
removeVersion(String requestPath, String version)
Remove the version from the request path.
Method Detail
extractVersion
@Nullable String extractVersion(String requestPath)
Extract the resource version from the request path.- Parameters:
requestPath
- the request path to check- Returns:
- the version string or
null
if none was found
removeVersion
String removeVersion(String requestPath, String version)
Remove the version from the request path. It is assumed that the given version was extracted viaextractVersion(String)
.- Parameters:
requestPath
- the request path of the resource being resolvedversion
- the version obtained fromextractVersion(String)
- Returns:
- the request path with the version removed
addVersion
String addVersion(String requestPath, String version)
Add a version to the given request path.- Parameters:
requestPath
- the requestPathversion
- the version- Returns:
- the requestPath updated with a version string
getResourceVersion
reactor.core.publisher.Mono<String> getResourceVersion(Resource resource)
Determine the version for the given resource.- Parameters:
resource
- the resource to check- Returns:
- the resource version