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

pack-priv Class DefaultResourceResolverChain

extends Object
implements ResourceResolverChain
Class Inheritance
All Implemented Interfaces
org.springframework.web.reactive.resource.ResourceResolverChain
Imports
java.util.ArrayList, .Collections, .List, .ListIterator, reactor.core.publisher.Mono, org.springframework.core.io.Resource, org.springframework.lang.Nullable, org.springframework.util.Assert, org.springframework.web.server.ServerWebExchange

Default immutable implementation of ResourceResolverChain.
Author
Rossen Stoyanchev
Since
5.0

Field Summary

Modifier and TypeField and Description
private final ResourceResolverChain
private final ResourceResolver

Constructor Summary

AccessConstructor and Description
public
private

Method Summary

Modifier and TypeMethod and Description
private static DefaultResourceResolverChain
initChain(ArrayList<? extends ResourceResolver> resolvers)

public Mono<Resource>
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
)

Implements org.springframework.web.reactive.resource.ResourceResolverChain.resolveResource.

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

public Mono<String>
resolveUrlPath(String
the internal resource path
resourcePath
,
List<? extends Resource>
the locations to search in when looking up resources
locations
)

Implements org.springframework.web.reactive.resource.ResourceResolverChain.resolveUrlPath.

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nextChainback to summary
private final ResourceResolverChain nextChain
Annotations
@Nullable
resolverback to summary
private final ResourceResolver resolver
Annotations
@Nullable

Constructor Detail

DefaultResourceResolverChainback to summary
public DefaultResourceResolverChain(List<? extends ResourceResolver> resolvers)
DefaultResourceResolverChainback to summary
private DefaultResourceResolverChain(ResourceResolver resolver, ResourceResolverChain chain)

Method Detail

initChainback to summary
private static DefaultResourceResolverChain initChain(ArrayList<? extends ResourceResolver> resolvers)
resolveResourceback to summary
public Mono<Resource> resolveResource(ServerWebExchange exchange, String requestPath, List<? extends Resource> locations)

Implements org.springframework.web.reactive.resource.ResourceResolverChain.resolveResource.

Doc from org.springframework.web.reactive.resource.ResourceResolverChain.resolveResource.

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

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

Implements org.springframework.web.reactive.resource.ResourceResolverChain.resolveUrlPath.

Doc from org.springframework.web.reactive.resource.ResourceResolverChain.resolveUrlPath.

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

Annotations
@Override