类 EncodedResourceResolver
- 所有已实现的接口:
ResourceResolver
The list of supported contentCodings can
be configured, in order of preference, and each coding must be associated
with extensions.
Note that this resolver must be ordered ahead of a
VersionResourceResolver with a content-based, version strategy to
ensure the version calculation is not impacted by the encoding.
- 作者:
- Rossen Stoyanchev
-
嵌套类概要
嵌套类 -
字段概要
字段从类继承的字段 cn.taketoday.web.resource.AbstractResourceResolver
logger -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明private StringgetAcceptEncoding(RequestContext request) Return a read-only list with the supported content codings.private StringgetExtension(String coding) Return a read-only map with coding-to-extension mappings.voidregisterExtension(String coding, String extension) Java config friendly alternative tosetExtensions(Map).protected cn.taketoday.core.io.ResourceresolveResourceInternal(RequestContext request, String requestPath, List<? extends cn.taketoday.core.io.Resource> locations, ResourceResolvingChain chain) protected StringresolveUrlPathInternal(String resourceUrlPath, List<? extends cn.taketoday.core.io.Resource> locations, ResourceResolvingChain chain) voidsetContentCodings(List<String> codings) Configure the supported content codings in order of preference.voidsetExtensions(Map<String, String> extensions) Configure mappings from content codings to file extensions.从类继承的方法 cn.taketoday.web.resource.AbstractResourceResolver
resolveResource, resolveUrlPath
-
字段详细资料
-
DEFAULT_CODINGS
The default content codings. -
contentCodings
-
extensions
-
-
构造器详细资料
-
EncodedResourceResolver
public EncodedResourceResolver()
-
-
方法详细资料
-
setContentCodings
Configure the supported content codings in order of preference. The first coding that is present in the "Accept-Encoding" header for a given request, and that has a file present with the associated extension, is used.Note: Each coding must be associated with a file extension via
registerExtension(java.lang.String, java.lang.String)orsetExtensions(java.util.Map<java.lang.String, java.lang.String>). Also customizations to the list of codings here should be matched by customizations to the same list inCachingResourceResolverto ensure encoded variants of a resource are cached under separate keys.By default this property is set to ["br", "gzip"].
- 参数:
codings- one or more supported content codings
-
getContentCodings
Return a read-only list with the supported content codings. -
setExtensions
Configure mappings from content codings to file extensions. A dot "." will be prepended in front of the extension value if not present.By default this is configured with ["br" -> ".br"] and ["gzip" -> ".gz"].
- 参数:
extensions- the extensions to use.- 另请参阅:
-
getExtensions
Return a read-only map with coding-to-extension mappings. -
registerExtension
Java config friendly alternative tosetExtensions(Map).- 参数:
coding- the content codingextension- the associated file extension
-
resolveResourceInternal
protected cn.taketoday.core.io.Resource resolveResourceInternal(@Nullable RequestContext request, String requestPath, List<? extends cn.taketoday.core.io.Resource> locations, ResourceResolvingChain chain) -
getAcceptEncoding
-
getExtension
-
resolveUrlPathInternal
protected String resolveUrlPathInternal(String resourceUrlPath, List<? extends cn.taketoday.core.io.Resource> locations, ResourceResolvingChain chain)
-