In spring I can use ResourceLoader and ResourcePatternUtils:
class Foobar {
private ResourceLoader resourceLoader;
@Autowired
public Foobar(ResourceLoader resourceLoader) {
this.resourceLoader = resourceLoader;
}
Resource[] loadResources(String pattern) throws IOException {
return ResourcePatternUtils.getResourcePatternResolver(resourceLoader).getResources(pattern);
}
}
and use it
Resource[] resources = foobar.loadResources("classpath*:../../dir/*.txt");
How I can do it in Micronaut?
I find one solution Is there an equivalent for Springs Resource in Micronaut?
ADD
@Inject
private DefaultClassPathResourceLoader resourceLoader;
...
Stream<URL> currencyStream = resourceLoader.getResources("currency/*.json");
long count = currencyStream.count();
...
But count always 0 =(