类 ResourceTransformerSupport
java.lang.Object
cn.taketoday.web.resource.ResourceTransformerSupport
- 所有已实现的接口:
ResourceTransformer
- 直接已知子类:
CssLinkResourceTransformer
A base class for a
ResourceTransformer with an optional helper method
for resolving public links within a transformed resource.- 从以下版本开始:
- 4.0
- 作者:
- Brian Clozel, Rossen Stoyanchev, Juergen Hoeller
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Return the configuredResourceUrlProvider.protected StringresolveUrlPath(String resourcePath, RequestContext request, cn.taketoday.core.io.Resource resource, ResourceTransformerChain transformerChain) A transformer can use this method when a resource being transformed contains links to other resources.voidsetResourceUrlProvider(ResourceUrlProvider resourceUrlProvider) Configure aResourceUrlProviderto use when resolving the public URL of links in a transformed resource (e.g. import links in a CSS file).protected StringtoAbsolutePath(String path, RequestContext request) Transform the given relative request path to an absolute path, taking the path of the given request as a point of reference.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.web.resource.ResourceTransformer
transform
-
字段详细资料
-
resourceUrlProvider
-
-
构造器详细资料
-
ResourceTransformerSupport
public ResourceTransformerSupport()
-
-
方法详细资料
-
setResourceUrlProvider
Configure aResourceUrlProviderto use when resolving the public URL of links in a transformed resource (e.g. import links in a CSS file). This is required only for links expressed as full paths and not for relative links. -
getResourceUrlProvider
Return the configuredResourceUrlProvider. -
resolveUrlPath
@Nullable protected String resolveUrlPath(String resourcePath, RequestContext request, cn.taketoday.core.io.Resource resource, ResourceTransformerChain transformerChain) A transformer can use this method when a resource being transformed contains links to other resources. Such links need to be replaced with the public facing link as determined by the resource resolver chain (e.g. the public URL may have a version inserted).- 参数:
resourcePath- the path to a resource that needs to be re-writtenrequest- the current requestresource- the resource being transformedtransformerChain- the transformer chain- 返回:
- the resolved URL, or if not resolvable
-
toAbsolutePath
Transform the given relative request path to an absolute path, taking the path of the given request as a point of reference. The resulting path is also cleaned from sequences like "path/..".- 参数:
path- the relative path to transformrequest- the referer request- 返回:
- the absolute request path for the given resource path
-