类 AppCacheManifestTransformer
- java.lang.Object
- org.springframework.web.reactive.resource.ResourceTransformerSupport
- org.springframework.web.reactive.resource.AppCacheManifestTransformer
- 所有已实现的接口:
ResourceTransformer
public class AppCacheManifestTransformer extends ResourceTransformerSupport
AResourceTransformer
HTML5 AppCache manifests.This transformer:
- modifies links to match the public URL paths that should be exposed to clients, using configured
ResourceResolver
strategies - appends a comment in the manifest, containing a Hash (e.g. "# Hash: 9de0f09ed7caf84e885f1f0f11c7e326"), thus changing the content of the manifest in order to trigger an appcache reload in the browser.
All files with an ".appcache" file extension (or the extension given to the constructor) will be transformed by this class. The hash is computed using the content of the appcache manifest so that changes in the manifest should invalidate the browser cache. This should also work with changes in referenced resources whose links are also versioned.
- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev, Brian Clozel
- 另请参阅:
- HTML5 offline applications spec
构造器概要
构造器 构造器 说明 AppCacheManifestTransformer()
Create an AppCacheResourceTransformer that transforms files with extension ".appcache".AppCacheManifestTransformer(String fileExtension)
Create an AppCacheResourceTransformer that transforms files with the extension given as a parameter.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 reactor.core.publisher.Mono<Resource>
transform(ServerWebExchange exchange, Resource inputResource, ResourceTransformerChain chain)
Transform the given resource.从类继承的方法 org.springframework.web.reactive.resource.ResourceTransformerSupport
getResourceUrlProvider, resolveUrlPath, setResourceUrlProvider, toAbsolutePath
构造器详细资料
AppCacheManifestTransformer
public AppCacheManifestTransformer()
Create an AppCacheResourceTransformer that transforms files with extension ".appcache".
AppCacheManifestTransformer
public AppCacheManifestTransformer(String fileExtension)
Create an AppCacheResourceTransformer that transforms files with the extension given as a parameter.
方法详细资料
transform
public reactor.core.publisher.Mono<Resource> transform(ServerWebExchange exchange, Resource inputResource, ResourceTransformerChain chain)
从接口复制的说明:ResourceTransformer
Transform the given resource.- 参数:
exchange
- the current exchangeinputResource
- the resource to transformchain
- the chain of remaining transformers to delegate to- 返回:
- the transformed resource (never empty)