public class PathMatchingSimpleStorageResourcePatternResolver extends Object implements ResourcePatternResolver
ResourcePatternResolver implementation which allows an ant-style path
matching when loading S3 resources. Ant wildcards (*, ** and ?) are allowed in both,
bucket name and object name.
WARNING: Be aware that when you are using wildcards in the bucket name it can
take a very long time to parse all files. Moreover this implementation does not return
truncated results. This means that when handling huge buckets it could lead to serious
performance problems. For more information look at the
findProgressivelyWithPartialMatch method.
CLASSPATH_ALL_URL_PREFIXCLASSPATH_URL_PREFIX| Constructor and Description |
|---|
PathMatchingSimpleStorageResourcePatternResolver(com.amazonaws.services.s3.AmazonS3 amazonS3,
ResourcePatternResolver resourcePatternResolverDelegate)
Construct a new instance of the
PathMatchingSimpleStorageResourcePatternResolver with a
SimpleStorageProtocolResolver to load AmazonS3 instances, and also a
delegate ResourcePatternResolver to resolve resource on default path (like
file and classpath). |
| Modifier and Type | Method and Description |
|---|---|
protected Resource[] |
findPathMatchingResources(String locationPattern) |
ClassLoader |
getClassLoader() |
Resource |
getResource(String location) |
Resource[] |
getResources(String locationPattern) |
void |
setPathMatcher(PathMatcher pathMatcher)
Set the PathMatcher implementation to use for this resource pattern resolver.
|
public PathMatchingSimpleStorageResourcePatternResolver(com.amazonaws.services.s3.AmazonS3 amazonS3,
ResourcePatternResolver resourcePatternResolverDelegate)
PathMatchingSimpleStorageResourcePatternResolver with a
SimpleStorageProtocolResolver to load AmazonS3 instances, and also a
delegate ResourcePatternResolver to resolve resource on default path (like
file and classpath).amazonS3 - - used to retrieve the directory listingsresourcePatternResolverDelegate - - delegate resolver used to resolve common
path (file, classpath, servlet etc.)public void setPathMatcher(PathMatcher pathMatcher)
pathMatcher - The pathMatches implementation used, must not be nullAntPathMatcherpublic Resource[] getResources(String locationPattern) throws IOException
getResources in interface ResourcePatternResolverIOExceptionpublic Resource getResource(String location)
getResource in interface ResourceLoaderpublic ClassLoader getClassLoader()
getClassLoader in interface ResourceLoaderCopyright © 2022 Pivotal Software, Inc.. All rights reserved.