protected static class AbstractVersionStrategy.PrefixVersionPathStrategy extends java.lang.Object implements VersionPathStrategy
VersionPathStrategy
,
e.g. "{version}/path/foo.js"
.Modifier and Type | Field and Description |
---|---|
private java.lang.String |
prefix |
Constructor and Description |
---|
PrefixVersionPathStrategy(java.lang.String version) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
addVersion(java.lang.String path,
java.lang.String version)
Add a version to the given request path.
|
java.lang.String |
extractVersion(java.lang.String requestPath)
Extract the resource version from the request path.
|
java.lang.String |
removeVersion(java.lang.String requestPath,
java.lang.String version)
Remove the version from the request path.
|
public PrefixVersionPathStrategy(java.lang.String version)
public java.lang.String extractVersion(java.lang.String requestPath)
VersionPathStrategy
extractVersion
in interface VersionPathStrategy
requestPath
- the request path to checknull
if none was foundpublic java.lang.String removeVersion(java.lang.String requestPath, java.lang.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 java.lang.String addVersion(java.lang.String path, java.lang.String version)
VersionPathStrategy
addVersion
in interface VersionPathStrategy
path
- the requestPathversion
- the version