@Test void testLoadingClasspathFile() throws Exception { AmazonS3 amazonS3 = mock(AmazonS3.class); ResourcePatternResolver resourceLoader = getResourceLoader(amazonS3); Resource[] resources = resourceLoader.getResources( "classpath*:org/springframework/cloud/aws/core/io/s3/PathMatchingSimpleStorageResourcePatternResolverTest.class"); assertThat(resources.length).isEqualTo(1); assertThat(resources[0].exists()).as("load without wildcards").isTrue(); Resource[] resourcesWithFileNameWildcard = resourceLoader.getResources( "classpath*:orgPathMatchingSimpleStorageResourcePatternResolverTes?.class"); assertThat(resourcesWithFileNameWildcard.length).isEqualTo(1); assertThat(resourcesWithFileNameWildcard[0].exists()).as("load with wildcards") .isTrue(); }
@Override public Resource[] getResources(String locationPattern) throws IOException { if (SimpleStorageNameUtils.isSimpleStorageResource(locationPattern)) { if (this.pathMatcher .isPattern(SimpleStorageNameUtils.stripProtocol(locationPattern))) { LOGGER.debug("Found wildcard pattern in location {}", locationPattern); return findPathMatchingResources(locationPattern); } else { return new Resource[] { this.resourcePatternResolverDelegate .getResource(locationPattern) }; } } else { return this.resourcePatternResolverDelegate.getResources(locationPattern); } }
PathMatchingSimpleStorageResourcePatternResolver implements ResourcePatternResolver { @Override public Resource[] getResources(String locationPattern) throws IOException { if (SimpleStorageNameUtils.isSimpleStorageResource(locationPattern)) { if (this.pathMatcher .isPattern(SimpleStorageNameUtils.stripProtocol(locationPattern))) { LOGGER.debug("Found wildcard pattern in location {}", locationPattern); return findPathMatchingResources(locationPattern); } else { return new Resource[] { this.resourcePatternResolverDelegate .getResource(locationPattern) }; } } else { return this.resourcePatternResolverDelegate.getResources(locationPattern); } } }
PathMatchingSimpleStorageResourcePatternResolver implements ResourcePatternResolver { @Override public Resource[] getResources(String locationPattern) throws IOException { if (SimpleStorageNameUtils.isSimpleStorageResource(locationPattern)) { if (this.pathMatcher .isPattern(SimpleStorageNameUtils.stripProtocol(locationPattern))) { LOGGER.debug("Found wildcard pattern in location {}", locationPattern); return findPathMatchingResources(locationPattern); } else { return new Resource[] { this.resourcePatternResolverDelegate .getResource(locationPattern) }; } } else { return this.resourcePatternResolverDelegate.getResources(locationPattern); } } PathMatchingSimpleStorageResourcePatternResolver(AmazonS3 amazonS3,
			ResourcePatternResolver resourcePatternResolverDelegate); }
PathMatchingSimpleStorageResourcePatternResolver implements ResourcePatternResolver { @Override public Resource[] getResources(String locationPattern) throws IOException { if (SimpleStorageNameUtils.isSimpleStorageResource(locationPattern)) { if (this.pathMatcher .isPattern(SimpleStorageNameUtils.stripProtocol(locationPattern))) { LOGGER.debug("Found wildcard pattern in location {}", locationPattern); return findPathMatchingResources(locationPattern); } else { return new Resource[] { this.resourcePatternResolverDelegate .getResource(locationPattern) }; } } else { return this.resourcePatternResolverDelegate.getResources(locationPattern); } } PathMatchingSimpleStorageResourcePatternResolver(AmazonS3 amazonS3,
			ResourcePatternResolver resourcePatternResolverDelegate); void setPathMatcher(PathMatcher pathMatcher); @Override Resource[] getResources(String locationPattern); @Override Resource getResource(String location); @Override ClassLoader getClassLoader(); }
PathMatchingSimpleStorageResourcePatternResolver implements ResourcePatternResolver { @Override public Resource[] getResources(String locationPattern) throws IOException { if (SimpleStorageNameUtils.isSimpleStorageResource(locationPattern)) { if (this.pathMatcher .isPattern(SimpleStorageNameUtils.stripProtocol(locationPattern))) { LOGGER.debug("Found wildcard pattern in location {}", locationPattern); return findPathMatchingResources(locationPattern); } else { return new Resource[] { this.resourcePatternResolverDelegate .getResource(locationPattern) }; } } else { return this.resourcePatternResolverDelegate.getResources(locationPattern); } } PathMatchingSimpleStorageResourcePatternResolver(AmazonS3 amazonS3,
			ResourcePatternResolver resourcePatternResolverDelegate); void setPathMatcher(PathMatcher pathMatcher); @Override Resource[] getResources(String locationPattern); @Override Resource getResource(String location); @Override ClassLoader getClassLoader();  }