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

public Interface ResourceResolverChain

Known Direct Implementers
org.springframework.web.reactive.resource.DefaultResourceResolverChain
Imports
java.util.List, reactor.core.publisher.Mono, org.springframework.core.io.Resource, org.springframework.lang.Nullable, org.springframework.web.server.ServerWebExchange

A contract for invoking a chain of ResourceResolvers where each resolver is given a reference to the chain allowing it to delegate when necessary.
Author
Rossen Stoyanchev
Since
5.0

Method Summary

Modifier and TypeMethod and Description
public Mono<Resource>

Returns:

the resolved resource; or an empty Mono if unresolved
resolveResource
(ServerWebExchange
the current exchange
exchange
,
String
the portion of the request path to use
requestPath
,
List<? extends Resource>
the locations to search in when looking up resources
locations
)

Resolve the supplied request and request path to a Resource that exists under one of the given resource locations.

public Mono<String>

Returns:

the resolved public URL path; or an empty Mono if unresolved
resolveUrlPath
(String
the internal resource path
resourcePath
,
List<? extends Resource>
the locations to search in when looking up resources
locations
)

Resolve the externally facing public URL path for clients to use to access the resource that is located at the given internal resource path.

Method Detail

resolveResourceback to summary
public Mono<Resource> resolveResource(ServerWebExchange exchange, String requestPath, List<? extends Resource> locations)

Resolve the supplied request and request path to a Resource that exists under one of the given resource locations.

Parameters
exchange:ServerWebExchange

the current exchange

requestPath:String

the portion of the request path to use

locations:List<? extends Resource>

the locations to search in when looking up resources

Returns:Mono<Resource>

the resolved resource; or an empty Mono if unresolved

resolveUrlPathback to summary
public Mono<String> resolveUrlPath(String resourcePath, List<? extends Resource> locations)

Resolve the externally facing public URL path for clients to use to access the resource that is located at the given internal resource path.

This is useful when rendering URL links to clients.

Parameters
resourcePath:String

the internal resource path

locations:List<? extends Resource>

the locations to search in when looking up resources

Returns:Mono<String>

the resolved public URL path; or an empty Mono if unresolved