|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.elca.el4j.core.io.support.ListResourcePatternResolverDecorator
public class ListResourcePatternResolverDecorator
This class resolves resources using a list of resource names to preserve
a specific order. A request is delegated to another
ResourcePatternResolver, if there
are no resources found by this class. Hence the list of resource names does
not have to be exhaustive.
| Field Summary |
|---|
| Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver |
|---|
CLASSPATH_ALL_URL_PREFIX |
| Fields inherited from interface org.springframework.core.io.ResourceLoader |
|---|
CLASSPATH_URL_PREFIX |
| Constructor Summary | |
|---|---|
ListResourcePatternResolverDecorator(ConfigLocationProvider locationProvider)
Creates a new instance using a PathMatchingResourcePatternResolver to delegate unresolved requests to
and an AntPathMatcher to interprete wildcard notations. |
|
ListResourcePatternResolverDecorator(ConfigLocationProvider locationProvider,
ResourcePatternResolver patternResovler)
Creates a new instance using a AntPathMatcher to interprete
wildcard notations. |
|
ListResourcePatternResolverDecorator(ConfigLocationProvider locationProvider,
ResourcePatternResolver patternResovler,
PathMatcher pathMatcher)
Creates a new instance, that is fully configured through constructor arguments. |
|
| Method Summary | |
|---|---|
protected void |
debugArray(String msg,
Object[] array)
Debugs the given array. |
protected Resource |
delegateResourceLookup(String location)
Resolves the given location into one resource, using delegation. |
protected Resource[] |
delegateResourcesLookup(String locationPattern)
Resolves the given location into Resource objects, using delegation. |
protected Resource[] |
findAllClassPathResources(String location)
Finds all resources that do not contain any wildcards except the classpath*. |
protected Resource[] |
findAllMatchingResources(String locationPattern)
Finds all resources that match the given location pattern that is interpreted by the path matcher which this class is configured for. |
protected Resource |
findFirstClassPathResource(String location)
|
protected Resource |
findLastClassPathResource(String location)
|
protected Resource |
findSingleClassPathResource(String location)
|
ClassLoader |
getClassLoader()
|
protected PathMatcher |
getPathMatcher()
|
ResourcePatternResolver |
getPatternResolver()
|
Resource |
getResource(String location)
|
Resource[] |
getResources(String locationPattern)
|
boolean |
isMergeWithOuterResources()
|
boolean |
isMostSpecificResourceLast()
|
protected Resource[] |
mergeResources(Resource[] former,
Resource[] latter)
Merges the two given list of resources with the former having higher precedence, i.e. they are added to the resulting list's head. |
void |
setMergeWithOuterResources(boolean mergeWithOuterResources)
Sets whether resources that are hold in this classe's resource list have to be merged with resources looked up in the file system. |
void |
setMostSpecificResourceLast(boolean mostSpecificResourceLast)
|
void |
setPathMatcher(PathMatcher pathMathcher)
Sets a specific path matcher that is used to interprete a specific wildcard notation. |
void |
setPatternResolver(ResourcePatternResolver patternResolver)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ListResourcePatternResolverDecorator(ConfigLocationProvider locationProvider)
PathMatchingResourcePatternResolver to delegate unresolved requests to
and an AntPathMatcher to interprete wildcard notations.
locationProvider - The configuration location provider to get the locations from.
public ListResourcePatternResolverDecorator(ConfigLocationProvider locationProvider,
ResourcePatternResolver patternResovler)
AntPathMatcher to interprete
wildcard notations.
locationProvider - The configuration location provider to get the locations from.patternResovler - The pattern resolver to delegate unresolved requests to.
public ListResourcePatternResolverDecorator(ConfigLocationProvider locationProvider,
ResourcePatternResolver patternResovler,
PathMatcher pathMatcher)
locationProvider - The configuration location provider to use.patternResovler - The pattern resolver to delegate unresolved requests to.pathMatcher - The path matcher that interprets a specific wildcard notation.| Method Detail |
|---|
public ResourcePatternResolver getPatternResolver()
public void setPatternResolver(ResourcePatternResolver patternResolver)
patternResolver - Is the patternResolver to set.protected PathMatcher getPathMatcher()
public void setPathMatcher(PathMatcher pathMathcher)
pathMathcher - The path matcher to set.public boolean isMergeWithOuterResources()
public void setMergeWithOuterResources(boolean mergeWithOuterResources)
mergeWithOuterResources - true to merge file system resources with the ones hold
in this classe's resource list. false to force
closed-world assumption.public boolean isMostSpecificResourceLast()
public void setMostSpecificResourceLast(boolean mostSpecificResourceLast)
mostSpecificResourceLast - Is the mostSpecificResourceLast to set.public Resource getResource(String location)
getResource in interface ResourceLoader
public Resource[] getResources(String locationPattern)
throws IOException
getResources in interface ResourcePatternResolverIOException
protected Resource[] delegateResourcesLookup(String locationPattern)
throws IOException
locationPattern - The pattern to resolve.
IOException - If an I/O error occurs.protected Resource delegateResourceLookup(String location)
location - The location to resolve.
protected Resource[] findAllMatchingResources(String locationPattern)
locationPattern - The location pattern to match against (contains a particular
wildcard notation).
protected Resource[] findAllClassPathResources(String location)
classpath*.
location - The location pattern to match resources against (without any
particular wildcard notation).
protected Resource findSingleClassPathResource(String location)
location - Is the looked up resource location.
protected Resource findFirstClassPathResource(String location)
throws IOException
location - Is the looked up resource location.
IOException - On any io problem.
protected Resource findLastClassPathResource(String location)
throws IOException
location - Is the looked up resource location.
mergeWithOuterResources is set to true
this method will try to find a resource that is not in the
config location list.
IOException - On any io problem.
protected Resource[] mergeResources(Resource[] former,
Resource[] latter)
throws IOException
former - A list of resources that has higher precedence.latter - A list of resources that has lower precedence. Items that are
already added by the former list are filtered.
IOException - If an I/O exception occurs.
protected void debugArray(String msg,
Object[] array)
msg - An arbitrary message prepended to the array.array - The array to debug.public ClassLoader getClassLoader()
getClassLoader in interface ResourceLoader
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||