类 AbstractPrefixVersionStrategy
- java.lang.Object
- org.springframework.web.reactive.resource.AbstractPrefixVersionStrategy
- 所有已实现的接口:
VersionStrategy
- 直接已知子类:
FixedVersionStrategy
public abstract class AbstractPrefixVersionStrategy extends Object implements VersionStrategy
Abstract base class forVersionStrategyimplementations that insert a prefix into the URL path, e.g. "version/static/myresource.js".- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev, Brian Clozel
构造器概要
构造器 限定符 构造器 说明 protectedAbstractPrefixVersionStrategy(String version)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 StringaddVersion(String path, String version)Add a version to the given request path.StringextractVersion(String requestPath)Extract the resource version from the request path.StringremoveVersion(String requestPath, String version)Remove the version from the request path.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.web.reactive.resource.VersionStrategy
getResourceVersion
构造器详细资料
AbstractPrefixVersionStrategy
protected AbstractPrefixVersionStrategy(String version)
方法详细资料
extractVersion
public String extractVersion(String requestPath)
从接口复制的说明:VersionStrategyExtract the resource version from the request path.- 指定者:
extractVersion在接口中VersionStrategy- 参数:
requestPath- the request path to check- 返回:
- the version string or
nullif none was found
removeVersion
public String removeVersion(String requestPath, String version)
从接口复制的说明:VersionStrategyRemove the version from the request path. It is assumed that the given version was extracted viaVersionStrategy.extractVersion(String).- 指定者:
removeVersion在接口中VersionStrategy- 参数:
requestPath- the request path of the resource being resolvedversion- the version obtained fromVersionStrategy.extractVersion(String)- 返回:
- the request path with the version removed
addVersion
public String addVersion(String path, String version)
从接口复制的说明:VersionStrategyAdd a version to the given request path.- 指定者:
addVersion在接口中VersionStrategy- 参数:
path- the requestPathversion- the version- 返回:
- the requestPath updated with a version string