org.springframework.web.reactive.resource

Interface ResourceResolverChain



  • public interface ResourceResolverChain
    A contract for invoking a chain of ResourceResolvers where each resolver is given a reference to the chain allowing it to delegate when necessary.
    Since:
    5.0
    Author:
    Rossen Stoyanchev
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      reactor.core.publisher.Mono<Resource> resolveResource(ServerWebExchange exchange, java.lang.String requestPath, java.util.List<? extends Resource> locations)
      Resolve the supplied request and request path to a Resource that exists under one of the given resource locations.
      reactor.core.publisher.Mono<java.lang.String> resolveUrlPath(java.lang.String resourcePath, java.util.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.
    • Method Detail

      • resolveResource

        reactor.core.publisher.Mono<Resource> resolveResource(@Nullable
                                                              ServerWebExchange exchange,
                                                              java.lang.String requestPath,
                                                              java.util.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 - the current exchange
        requestPath - the portion of the request path to use
        locations - the locations to search in when looking up resources
        Returns:
        the resolved resource; or an empty Mono if unresolved
      • resolveUrlPath

        reactor.core.publisher.Mono<java.lang.String> resolveUrlPath(java.lang.String resourcePath,
                                                                     java.util.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 - the internal resource path
        locations - the locations to search in when looking up resources
        Returns:
        the resolved public URL path; or an empty Mono if unresolved