Package org.springframework.web.servlet.resource

# Class AbstractResourceResolver

java.lang.Object
org.springframework.web.servlet.resource.AbstractResourceResolver

All Implemented Interfaces:
  `ResourceResolver`

Direct Known Subclasses:
  `CachingResourceResolver`, `EncodedResourceResolver`, `LiteWebJarsResourceResolver`, `PathResourceResolver`, `VersionResourceResolver`, `WebJarsResourceResolver`

public abstract class AbstractResourceResolver extends Object implements ResourceResolver
Base class for `ResourceResolver` implementations. Provides consistent logging.

Since:
  4.1
Author:
  Rossen Stoyanchev

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final org.apache.commons.logging.Log`
`logger`

## Constructor Summary

Constructors
Constructor
Description
`AbstractResourceResolver()`

## Method Summary

Modifier and Type
Method
Description
`org.springframework.core.io.Resource`
`resolveResource(HttpServletRequest request, String requestPath, List<? extends org.springframework.core.io.Resource> locations, ResourceResolverChain chain)`
Resolve the supplied request and request path to a `Resource` that exists under one of the given resource locations.
`protected abstract org.springframework.core.io.Resource`
`resolveResourceInternal(HttpServletRequest request, String requestPath, List<? extends org.springframework.core.io.Resource> locations, ResourceResolverChain chain)`
`String`
`resolveUrlPath(String resourceUrlPath, List<? extends org.springframework.core.io.Resource> locations, ResourceResolverChain chain)`
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 String`
`resolveUrlPathInternal(String resourceUrlPath, List<? extends org.springframework.core.io.Resource> locations, ResourceResolverChain chain)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### logger

protected final org.apache.commons.logging.Log logger

## Constructor Details

### AbstractResourceResolver

public AbstractResourceResolver()

## Method Details

### resolveResource

@Nullable public org.springframework.core.io.Resource resolveResource(@Nullable HttpServletRequest request, String requestPath, List<? extends org.springframework.core.io.Resource> locations, ResourceResolverChain chain)
Description copied from interface: `ResourceResolver`
Resolve the supplied request and request path to a `Resource` that exists under one of the given resource locations.

Specified by:
  `resolveResource` in interface `ResourceResolver`
Parameters:
  `request` - the current request (may not be present in some calls)
  `requestPath` - the portion of the request path to use
  `locations` - the locations to search in when looking up resources
  `chain` - the chain of remaining resolvers to delegate to
Returns:
  the resolved resource, or `null` if unresolved

### resolveUrlPath

@Nullable public String resolveUrlPath(String resourceUrlPath, List<? extends org.springframework.core.io.Resource> locations, ResourceResolverChain chain)
Description copied from interface: `ResourceResolver`
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.

Specified by:
  `resolveUrlPath` in interface `ResourceResolver`
Parameters:
  `resourceUrlPath` - the internal resource path
  `locations` - the locations to search in when looking up resources
  `chain` - the chain of resolvers to delegate to
Returns:
  the resolved public URL path, or `null` if unresolved

### resolveResourceInternal

@Nullable protected abstract org.springframework.core.io.Resource resolveResourceInternal(@Nullable HttpServletRequest request, String requestPath, List<? extends org.springframework.core.io.Resource> locations, ResourceResolverChain chain)

### resolveUrlPathInternal

@Nullable protected abstract String resolveUrlPathInternal(String resourceUrlPath, List<? extends org.springframework.core.io.Resource> locations, ResourceResolverChain chain)