From a315abfd328e8a607686a38d6b78d4279d0d3a1a Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 16 Feb 2021 10:18:13 +0100 Subject: [PATCH] Polish ResourcePatternResolver docuementation in the reference manual See gh-26447 --- src/docs/asciidoc/core/core-resources.adoc | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/docs/asciidoc/core/core-resources.adoc b/src/docs/asciidoc/core/core-resources.adoc index 7d10aea86e26..e6aa152cd5ff 100644 --- a/src/docs/asciidoc/core/core-resources.adoc +++ b/src/docs/asciidoc/core/core-resources.adoc @@ -460,12 +460,18 @@ contain multiple files with the same path and the same name. See on wildcard support with the `classpath*:` resource prefix. A passed-in `ResourceLoader` (for example, one supplied via -<> semantics can be checked whether +<> semantics) can be checked whether it implements this extended interface too. `PathMatchingResourcePatternResolver` is a standalone implementation that is usable outside an `ApplicationContext` and is also used by `ResourceArrayPropertyEditor` for -populating `Resource[]` bean properties. +populating `Resource[]` bean properties. `PathMatchingResourcePatternResolver` is able to +resolve a specified resource location path into one or more matching `Resource` objects. +The source path may be a simple path which has a one-to-one mapping to a target +`Resource`, or alternatively may contain the special `classpath*:` prefix and/or internal +Ant-style regular expressions (matched using Spring's +`org.springframework.util.AntPathMatcher` utility). Both of the latter are effectively +wildcards. [NOTE] ==== @@ -477,6 +483,8 @@ implements the `ResourcePatternResolver` interface and delegates to the default ==== + + [[resources-resourceloaderaware]] == The `ResourceLoaderAware` Interface @@ -525,6 +533,11 @@ constructor argument, or method parameter that expects the `ResourceLoader` type as the field, constructor, or method in question carries the `@Autowired` annotation. For more information, see <>. +NOTE: To load one or more `Resource` objects for a resource path that contains wildcards +or makes use of the special `classpath*:` resource prefix, consider having an instance of +<> autowired into your +application components instead of `ResourceLoader`. +