Top Description Methods
org.springframework.web.servlet.resource

public Interface ResourceTransformer

Known Direct Implementers
org.springframework.web.servlet.resource.ResourceTransformerSupport, org.springframework.web.servlet.resource.CachingResourceTransformer
Annotations
@FunctionalInterface
Imports
java.io.IOException, jakarta.servlet.http.HttpServletRequest, org.springframework.core.io.Resource

An abstraction for transforming the content of a resource.
Authors
Jeremy Grelle, Rossen Stoyanchev
Since
4.1

Method Summary

Modifier and TypeMethod and Description
public Resource

Returns:

the transformed resource (never null)
transform
(HttpServletRequest
the current request
request
,
Resource
the resource to transform
resource
,
ResourceTransformerChain
the chain of remaining transformers to delegate to
transformerChain
)

Transform the given resource.

Method Detail

transformback to summary
public Resource transform(HttpServletRequest request, Resource resource, ResourceTransformerChain transformerChain) throws IOException

Transform the given resource.

Parameters
request:HttpServletRequest

the current request

resource:Resource

the resource to transform

transformerChain:ResourceTransformerChain

the chain of remaining transformers to delegate to

Returns:Resource

the transformed resource (never null)

Exceptions
IOException:
if the transformation fails