接口 ResourceResolver
- 所有已知实现类:
AbstractResourceResolver,CachingResourceResolver,EncodedResourceResolver,PathResourceResolver,VersionResourceResolver,WebJarsResourceResolver
public interface ResourceResolver
A strategy for resolving a request to a server-side resource.
Provides mechanisms for resolving an incoming request to an actual
Resource and for obtaining the
public URL path that clients should use when requesting the resource.
- 从以下版本开始:
- 4.0
- 作者:
- Jeremy Grelle, Rossen Stoyanchev, Sam Brannen, Harry Yang
- 另请参阅:
-
方法概要
修饰符和类型方法说明cn.taketoday.core.io.ResourceresolveResource(RequestContext request, String requestPath, List<? extends cn.taketoday.core.io.Resource> locations, ResourceResolvingChain chain) Resolve the supplied request and request path to aResourcethat exists under one of the given resource locations.resolveUrlPath(String resourcePath, List<? extends cn.taketoday.core.io.Resource> locations, ResourceResolvingChain 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.
-
方法详细资料
-
resolveResource
@Nullable cn.taketoday.core.io.Resource resolveResource(@Nullable RequestContext request, String requestPath, List<? extends cn.taketoday.core.io.Resource> locations, ResourceResolvingChain chain) Resolve the supplied request and request path to aResourcethat exists under one of the given resource locations.- 参数:
request- the current request (may not be present in some calls)requestPath- the portion of the request path to uselocations- the locations to search in when looking up resourceschain- the chain of remaining resolvers to delegate to- 返回:
- the resolved resource, or
nullif unresolved
-
resolveUrlPath
@Nullable String resolveUrlPath(String resourcePath, List<? extends cn.taketoday.core.io.Resource> locations, ResourceResolvingChain 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.This is useful when rendering URL links to clients.
- 参数:
resourcePath- the internal resource pathlocations- the locations to search in when looking up resourceschain- the chain of resolvers to delegate to- 返回:
- the resolved public URL path, or
nullif unresolved
-