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

public abstract Class AbstractResourceResolver

extends Object
implements ResourceResolver
Class Inheritance
All Implemented Interfaces
org.springframework.web.reactive.resource.ResourceResolver
Known Direct Subclasses
org.springframework.web.reactive.resource.CachingResourceResolver, org.springframework.web.reactive.resource.EncodedResourceResolver, org.springframework.web.reactive.resource.PathResourceResolver, org.springframework.web.reactive.resource.VersionResourceResolver, org.springframework.web.reactive.resource.WebJarsResourceResolver
Imports
java.util.List, org.apache.commons.logging.Log, .LogFactory, reactor.core.publisher.Mono, org.springframework.core.io.Resource, org.springframework.lang.Nullable, org.springframework.web.server.ServerWebExchange

Base ResourceResolver providing consistent logging.
Author
Rossen Stoyanchev
Since
5.0

Field Summary

Modifier and TypeField and Description
protected final Log

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Mono<Resource>
resolveResource(ServerWebExchange
the current exchange
exchange
,
String
the portion of the request path to use. This is expected to be the encoded path, i.e. RequestPath#value().
requestPath
,
List<? extends Resource>
the locations to search in when looking up resources
locations
,
ResourceResolverChain
the chain of remaining resolvers to delegate to
chain
)

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

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

protected abstract Mono<Resource>
resolveResourceInternal(ServerWebExchange exchange, String requestPath, List<? extends Resource> locations, ResourceResolverChain chain)

public Mono<String>
resolveUrlPath(String
the "internal" resource path to resolve a path for public use. This is expected to be the encoded path.
resourceUrlPath
,
List<? extends Resource>
the locations to search in when looking up resources
locations
,
ResourceResolverChain
the chain of resolvers to delegate to
chain
)

Implements org.springframework.web.reactive.resource.ResourceResolver.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.

protected abstract Mono<String>
resolveUrlPathInternal(String resourceUrlPath, List<? extends Resource> locations, ResourceResolverChain chain)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

loggerback to summary
protected final Log logger

Constructor Detail

AbstractResourceResolverback to summary
public AbstractResourceResolver()

Method Detail

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

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

Doc from org.springframework.web.reactive.resource.ResourceResolver.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. This is expected to be the encoded path, i.e. RequestPath#value().

locations:List<? extends Resource>

the locations to search in when looking up resources

chain:ResourceResolverChain

the chain of remaining resolvers to delegate to

Returns:Mono<Resource>

the resolved resource or an empty Mono if unresolved

Annotations
@Override
resolveResourceInternalback to summary
protected abstract Mono<Resource> resolveResourceInternal(ServerWebExchange exchange, String requestPath, List<? extends Resource> locations, ResourceResolverChain chain)
resolveUrlPathback to summary
public Mono<String> resolveUrlPath(String resourceUrlPath, List<? extends Resource> locations, ResourceResolverChain chain)

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

Doc from org.springframework.web.reactive.resource.ResourceResolver.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
resourceUrlPath:String

the "internal" resource path to resolve a path for public use. This is expected to be the encoded path.

locations:List<? extends Resource>

the locations to search in when looking up resources

chain:ResourceResolverChain

the chain of resolvers to delegate to

Returns:Mono<String>

the resolved public URL path or an empty Mono if unresolved

Annotations
@Override
resolveUrlPathInternalback to summary
protected abstract Mono<String> resolveUrlPathInternal(String resourceUrlPath, List<? extends Resource> locations, ResourceResolverChain chain)