Interface ResourceTransformer

All Known Implementing Classes:
CachingResourceTransformer, CssLinkResourceTransformer, ResourceTransformerSupport
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ResourceTransformer
An abstraction for transforming the content of a resource.
Since:
4.1
Author:
Jeremy Grelle, Rossen Stoyanchev
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.core.io.Resource
    transform(HttpServletRequest request, org.springframework.core.io.Resource resource, ResourceTransformerChain transformerChain)
    Transform the given resource.
  • Method Details

    • transform

      org.springframework.core.io.Resource transform(HttpServletRequest request, org.springframework.core.io.Resource resource, ResourceTransformerChain transformerChain) throws IOException
      Transform the given resource.
      Parameters:
      request - the current request
      resource - the resource to transform
      transformerChain - the chain of remaining transformers to delegate to
      Returns:
      the transformed resource (never null)
      Throws:
      IOException - if the transformation fails