@ -16,6 +16,7 @@
package org.springframework.core.io.support ;
package org.springframework.core.io.support ;
import java.io.File ;
import java.io.FileNotFoundException ;
import java.io.FileNotFoundException ;
import java.io.IOException ;
import java.io.IOException ;
import java.util.ArrayList ;
import java.util.ArrayList ;
@ -96,6 +97,13 @@ class PathMatchingResourcePatternResolverTests {
StringUtils . concatenateStringArrays ( CLASSES_IN_CORE_IO_SUPPORT , TEST_CLASSES_IN_CORE_IO_SUPPORT ) ) ;
StringUtils . concatenateStringArrays ( CLASSES_IN_CORE_IO_SUPPORT , TEST_CLASSES_IN_CORE_IO_SUPPORT ) ) ;
}
}
@Test
void getResourcesOnFileSystemContainingHashtagsInTheirFileNames ( ) throws IOException {
Resource [ ] resources = resolver . getResources ( "classpath*:org/springframework/core/io/**/resource#test*.txt" ) ;
assertThat ( resources ) . extracting ( Resource : : getFile ) . extracting ( File : : getName )
. containsExactlyInAnyOrder ( "resource#test1.txt" , "resource#test2.txt" ) ;
}
@Test
@Test
void classpathWithPatternInJar ( ) throws IOException {
void classpathWithPatternInJar ( ) throws IOException {
Resource [ ] resources = resolver . getResources ( "classpath:org/reactivestreams/*.class" ) ;
Resource [ ] resources = resolver . getResources ( "classpath:org/reactivestreams/*.class" ) ;