1
|
package eu.dnetlib.index.utils;
|
2
|
|
3
|
import java.io.IOException;
|
4
|
import java.io.InputStream;
|
5
|
|
6
|
import org.junit.Test;
|
7
|
import org.springframework.core.io.Resource;
|
8
|
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
9
|
|
10
|
public class ZkUtilsTest {
|
11
|
|
12
|
@Test
|
13
|
public void test() throws IOException {
|
14
|
final PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
|
15
|
final Resource[] resources = resolver.getResources("classpath*:/eu/dnetlib/index/solr/conf/files/**");
|
16
|
|
17
|
for (final Resource r : resources) {
|
18
|
final InputStream is = r.getInputStream();
|
19
|
if ((r.getFilename() != null) && !r.getFilename().isEmpty()) {
|
20
|
System.out.println(r.getFilename());
|
21
|
is.close();
|
22
|
}
|
23
|
|
24
|
}
|
25
|
}
|
26
|
|
27
|
}
|