@Override public Set<String> list(String relativeTo, String path, boolean includeFiles, boolean includeDirectories, boolean recursive) throws IOException { Set<String> returnSet = new LinkedHashSet<String>(); if(path.startsWith("classpath*:")) { String tempFile = FilenameUtils.concat(FilenameUtils.getFullPath(relativeTo), path); final String classpathBasePath = path.substring("classpath*:".length()) + (path.endsWith("/") ? "" : "/"); PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); List<String> resources = Lists .newArrayList(resolver.getResources(tempFile + "*.xml")).stream() .sorted(Comparator.comparing(Resource::getFilename)) .map(resource -> "classpath:" + classpathBasePath + resource.getFilename()) .collect(Collectors.toList()); for (String res : resources) { returnSet.add(res); } return returnSet; }else{ return super.list(relativeTo,path,includeFiles,includeDirectories,recursive); } } }