I am trying to load all resources with a specific file-extension which are loaded dynamically at runtime using a URLClassloader.
Unfortunately the PathMatchingResour
Loading the files dynamically in Spring is simple, I'd change the approach to finding the files with extensions.
Try the following:
ClassLoader cl = this.getClass().getClassLoader();
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(cl);
Resource[] resources = resolver.getResources("classpath*:/*.xml") ;
for (Resource resource: resources){
logger.info(resource.getFilename());
}