接口 VersionStrategy
- 所有已知实现类:
AbstractFileNameVersionStrategy
,AbstractPrefixVersionStrategy
,ContentVersionStrategy
,FixedVersionStrategy
public interface VersionStrategy
A strategy to determine the version of a static resource and to apply and/or extract it from the URL path.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev, Brian Clozel
- 另请参阅:
VersionResourceResolver
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 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.reactor.core.publisher.Mono<String>
getResourceVersion(Resource resource)
Determine the version for the given resource.String
removeVersion(String requestPath, String version)
Remove the version from the request path.
方法详细资料
extractVersion
@Nullable String extractVersion(String requestPath)
Extract the resource version from the request path.- 参数:
requestPath
- the request path to check- 返回:
- the version string or
null
if none was found
removeVersion
String removeVersion(String requestPath, String version)
Remove the version from the request path. It is assumed that the given version was extracted viaextractVersion(String)
.- 参数:
requestPath
- the request path of the resource being resolvedversion
- the version obtained fromextractVersion(String)
- 返回:
- the request path with the version removed
addVersion
String addVersion(String requestPath, String version)
Add a version to the given request path.- 参数:
requestPath
- the requestPathversion
- the version- 返回:
- the requestPath updated with a version string
getResourceVersion
reactor.core.publisher.Mono<String> getResourceVersion(Resource resource)
Determine the version for the given resource.- 参数:
resource
- the resource to check- 返回:
- the resource version