public abstract class AbstractPrefixVersionStrategy extends java.lang.Object implements VersionStrategy
VersionStrategy
implementations that insert
a prefix into the URL path, e.g. "version/static/myresource.js".Modifier | Constructor and Description |
---|---|
protected |
AbstractPrefixVersionStrategy(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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getResourceVersion
protected final Log logger
protected AbstractPrefixVersionStrategy(java.lang.String version)
public java.lang.String extractVersion(java.lang.String requestPath)
VersionStrategy
extractVersion
in interface VersionStrategy
requestPath
- the request path to checknull
if none was foundpublic java.lang.String removeVersion(java.lang.String requestPath, java.lang.String version)
VersionStrategy
VersionStrategy.extractVersion(String)
.removeVersion
in interface VersionStrategy
requestPath
- the request path of the resource being resolvedversion
- the version obtained from VersionStrategy.extractVersion(String)
public java.lang.String addVersion(java.lang.String path, java.lang.String version)
VersionStrategy
addVersion
in interface VersionStrategy
path
- the requestPathversion
- the version