类 CssLinkResourceTransformer

java.lang.Object
cn.taketoday.web.resource.ResourceTransformerSupport
cn.taketoday.web.resource.CssLinkResourceTransformer
所有已实现的接口:
ResourceTransformer

public class CssLinkResourceTransformer extends ResourceTransformerSupport
A ResourceTransformer implementation that modifies links in a CSS file to match the public URL paths that should be exposed to clients (e.g. with an MD5 content-based hash inserted in the URL).

The implementation looks for links in CSS @import statements and also inside CSS url() functions. All links are then passed through the ResourceResolvingChain and resolved relative to the location of the containing CSS file. If successfully resolved, the link is modified, otherwise the original link is preserved.

从以下版本开始:
4.0
作者:
Rossen Stoyanchev
  • 字段详细资料

  • 构造器详细资料

    • CssLinkResourceTransformer

      public CssLinkResourceTransformer()
  • 方法详细资料

    • transform

      public cn.taketoday.core.io.Resource transform(RequestContext request, cn.taketoday.core.io.Resource resource, ResourceTransformerChain transformerChain) throws IOException
      从接口复制的说明: ResourceTransformer
      Transform the given resource.
      参数:
      request - the current request
      resource - the resource to transform
      transformerChain - the chain of remaining transformers to delegate to
      返回:
      the transformed resource (never null)
      抛出:
      IOException - if the transformation fails
    • hasScheme

      private boolean hasScheme(String link)