public class FixedVersionStrategy extends AbstractVersionStrategy
VersionStrategy
that relies on a fixed version applied as a request
path prefix, e.g. reduced SHA, version name, release date, etc.
This is useful for example when ContentVersionStrategy
cannot be
used such as when using JavaScript module loaders which are in charge of
loading the JavaScript resources and need to know their relative paths.
VersionResourceResolver
AbstractVersionStrategy.FileNameVersionPathStrategy, AbstractVersionStrategy.PrefixVersionPathStrategy
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
version |
logger
Constructor and Description |
---|
FixedVersionStrategy(java.lang.String version)
Create a new FixedVersionStrategy with the given version string.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getResourceVersion(Resource resource)
Determine the version for the given resource.
|
addVersion, extractVersion, getVersionPathStrategy, removeVersion
public FixedVersionStrategy(java.lang.String version)
version
- the fixed version string to usepublic java.lang.String getResourceVersion(Resource resource)
VersionStrategy
resource
- the resource to checknull
)