### Question:
ResourceUtils extends org.springframework.util.ResourceUtils { public static Resource[] getSubResources(String rootPath, String path, boolean all) { if (path == null || "".equals(path)) { return new Resource[0]; } if (!path.startsWith("/")) { log.warn("相对路径格式错误，没有以'/'开始：" + path); return new Resource[0]; } String jarPath = path; String dir = jarPath; if (matcher.isPattern(dir)) { dir = StringUtils.getPatternRoot(dir); } if (rootPath == null) { List<Resource> jarSubs = getSubResourcesForJar(dir, jarPath); return jarSubs.toArray(new Resource[jarSubs.size()]); } rootPath = StringUtils.cleanPath(rootPath); if (rootPath.endsWith("/")) { rootPath = rootPath.substring(0, rootPath.length() - 1); } List<Resource> fileSubs = getSubResourcesForFile(rootPath, dir, jarPath); if (!all) { return fileSubs.toArray(new Resource[fileSubs.size()]); } fileSubs.addAll(getSubResourcesForJar(dir, jarPath)); return fileSubs.toArray(new Resource[fileSubs.size()]); }  static String getShotFileName(Resource resource); static String getAbsolutePath(Resource resource); static List<URL> getUrls(String path); static List<Resource> loadResources(List<JarURLConnection> urls, String pattern); static Resource[] getSubResources(String rootPath, String path, boolean all); static String[] getSubs(String rootPath, String path, boolean all);  }### Answer:
@Test public void testGetSubResources() throws IOException { String rootPath = ResourceUtils.getAbsolutePath(ClassUtils.getClassesRootResource(ResourceUtils.class)); String path = "/org/webframe/support/driver/resource/**"; Resource[] resources = ResourceUtils.getSubResources(rootPath, path, true); Assert.assertEquals("获取资源文件错误！", resources.length, ResourceUtils.getSubs(rootPath, path, true).length); System.out.println(path + " <--> resource(size):" + resources.length); for (Resource resource : resources) { System.out.println("resource:" + resource); } }