public abstract class AbstractVersionStrategy extends Object implements VersionStrategy
VersionStrategy
implementations.
Supports versions as:
Note: This base class does not provide support for generating the version string.
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractVersionStrategy.FileNameVersionPathStrategy
File name-based
VersionPathStrategy ,
e.g. |
protected static class |
AbstractVersionStrategy.PrefixVersionPathStrategy
A prefix-based
VersionPathStrategy ,
e.g. |
Modifier | Constructor and Description |
---|---|
protected |
AbstractVersionStrategy(VersionPathStrategy pathStrategy) |
Modifier and Type | Method and 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.
|
VersionPathStrategy |
getVersionPathStrategy() |
String |
removeVersion(String requestPath,
String version)
Remove the version from the request path.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getResourceVersion
protected final Log logger
protected AbstractVersionStrategy(VersionPathStrategy pathStrategy)
public VersionPathStrategy getVersionPathStrategy()
@Nullable public String extractVersion(String requestPath)
VersionPathStrategy
extractVersion
in interface VersionPathStrategy
requestPath
- the request path to checknull
if none was foundpublic String removeVersion(String requestPath, String version)
VersionPathStrategy
VersionPathStrategy.extractVersion(String)
.removeVersion
in interface VersionPathStrategy
requestPath
- the request path of the resource being resolvedversion
- the version obtained from VersionPathStrategy.extractVersion(String)
public String addVersion(String requestPath, String version)
VersionPathStrategy
addVersion
in interface VersionPathStrategy
requestPath
- the requestPathversion
- the version