|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2007 the original author or authors. |
|
|
|
* Copyright 2002-2021 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -23,17 +23,18 @@ import org.springframework.core.io.ResourceLoader; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Strategy interface for resolving a location pattern (for example, |
|
|
|
* Strategy interface for resolving a location pattern (for example, |
|
|
|
* an Ant-style path pattern) into Resource objects. |
|
|
|
* an Ant-style path pattern) into {@link Resource} objects. |
|
|
|
* |
|
|
|
* |
|
|
|
* <p>This is an extension to the {@link org.springframework.core.io.ResourceLoader} |
|
|
|
* <p>This is an extension to the {@link org.springframework.core.io.ResourceLoader} |
|
|
|
* interface. A passed-in ResourceLoader (for example, an |
|
|
|
* interface. A passed-in {@code ResourceLoader} (for example, an |
|
|
|
* {@link org.springframework.context.ApplicationContext} passed in via |
|
|
|
* {@link org.springframework.context.ApplicationContext} passed in via |
|
|
|
* {@link org.springframework.context.ResourceLoaderAware} when running in a context) |
|
|
|
* {@link org.springframework.context.ResourceLoaderAware} when running in a context) |
|
|
|
* can be checked whether it implements this extended interface too. |
|
|
|
* can be checked whether it implements this extended interface too. |
|
|
|
* |
|
|
|
* |
|
|
|
* <p>{@link PathMatchingResourcePatternResolver} is a standalone implementation |
|
|
|
* <p>{@link PathMatchingResourcePatternResolver} is a standalone implementation |
|
|
|
* that is usable outside an ApplicationContext, also used by |
|
|
|
* that is usable outside an {@code ApplicationContext}, also used by |
|
|
|
* {@link ResourceArrayPropertyEditor} for populating Resource array bean properties. |
|
|
|
* {@link ResourceArrayPropertyEditor} for populating {@code Resource} array bean |
|
|
|
|
|
|
|
* properties. |
|
|
|
* |
|
|
|
* |
|
|
|
* <p>Can be used with any sort of location pattern (e.g. "/WEB-INF/*-context.xml"): |
|
|
|
* <p>Can be used with any sort of location pattern (e.g. "/WEB-INF/*-context.xml"): |
|
|
|
* Input patterns have to match the strategy implementation. This interface just |
|
|
|
* Input patterns have to match the strategy implementation. This interface just |
|
|
|
@ -42,7 +43,8 @@ import org.springframework.core.io.ResourceLoader; |
|
|
|
* <p>This interface also suggests a new resource prefix "classpath*:" for all |
|
|
|
* <p>This interface also suggests a new resource prefix "classpath*:" for all |
|
|
|
* matching resources from the class path. Note that the resource location is |
|
|
|
* matching resources from the class path. Note that the resource location is |
|
|
|
* expected to be a path without placeholders in this case (e.g. "/beans.xml"); |
|
|
|
* expected to be a path without placeholders in this case (e.g. "/beans.xml"); |
|
|
|
* JAR files or classes directories can contain multiple files of the same name. |
|
|
|
* JAR files or different directories in the class path can contain multiple files |
|
|
|
|
|
|
|
* of the same name. |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Juergen Hoeller |
|
|
|
* @author Juergen Hoeller |
|
|
|
* @since 1.0.2 |
|
|
|
* @since 1.0.2 |
|
|
|
@ -55,7 +57,7 @@ public interface ResourcePatternResolver extends ResourceLoader { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Pseudo URL prefix for all matching resources from the class path: "classpath*:" |
|
|
|
* Pseudo URL prefix for all matching resources from the class path: "classpath*:" |
|
|
|
* This differs from ResourceLoader's classpath URL prefix in that it |
|
|
|
* <p>This differs from ResourceLoader's classpath URL prefix in that it |
|
|
|
* retrieves all matching resources for a given name (e.g. "/beans.xml"), |
|
|
|
* retrieves all matching resources for a given name (e.g. "/beans.xml"), |
|
|
|
* for example in the root of all deployed JAR files. |
|
|
|
* for example in the root of all deployed JAR files. |
|
|
|
* @see org.springframework.core.io.ResourceLoader#CLASSPATH_URL_PREFIX |
|
|
|
* @see org.springframework.core.io.ResourceLoader#CLASSPATH_URL_PREFIX |
|
|
|
@ -63,12 +65,12 @@ public interface ResourcePatternResolver extends ResourceLoader { |
|
|
|
String CLASSPATH_ALL_URL_PREFIX = "classpath*:"; |
|
|
|
String CLASSPATH_ALL_URL_PREFIX = "classpath*:"; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Resolve the given location pattern into Resource objects. |
|
|
|
* Resolve the given location pattern into {@code Resource} objects. |
|
|
|
* <p>Overlapping resource entries that point to the same physical |
|
|
|
* <p>Overlapping resource entries that point to the same physical |
|
|
|
* resource should be avoided, as far as possible. The result should |
|
|
|
* resource should be avoided, as far as possible. The result should |
|
|
|
* have set semantics. |
|
|
|
* have set semantics. |
|
|
|
* @param locationPattern the location pattern to resolve |
|
|
|
* @param locationPattern the location pattern to resolve |
|
|
|
* @return the corresponding Resource objects |
|
|
|
* @return the corresponding {@code Resource} objects |
|
|
|
* @throws IOException in case of I/O errors |
|
|
|
* @throws IOException in case of I/O errors |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
Resource[] getResources(String locationPattern) throws IOException; |
|
|
|
Resource[] getResources(String locationPattern) throws IOException; |
|
|
|
|