### Question:
ResourceUtils extends org.springframework.util.ResourceUtils { public static String[] getSubs(String rootPath, String path, boolean all) { if (path == null || "".equals(path)) { return new String[0]; } if (!path.startsWith("/")) { log.warn("相对路径格式错误，没有以'/'开始：" + path); return new String[0]; } String jarPath = path.substring(1); String dir = jarPath; if (matcher.isPattern(jarPath)) { dir = StringUtils.getPatternRoot(jarPath); } if (rootPath == null) { Set<String> jarSubs = getSubsForJar(dir, jarPath); return jarSubs.toArray(new String[jarSubs.size()]); } rootPath = StringUtils.cleanPath(rootPath); if (!rootPath.endsWith("/")) { rootPath = rootPath + "/"; } Set<String> fileSubs = getSubsForFile(rootPath, dir, jarPath); if (!all) { return fileSubs.toArray(new String[fileSubs.size()]); } fileSubs.addAll(getSubsForJar(dir, jarPath)); return fileSubs.toArray(new String[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 testGetSubs() throws IOException { String rootPath = ResourceUtils.getAbsolutePath(ClassUtils.getClassesRootResource(ResourceUtils.class)) + "/"; String path = "/org/webframe/support/driver/resourceJarResource*.class"; String[] subs = ResourceUtils.getSubs(rootPath, path, true); Assert.assertEquals("获取资源文件错误！", subs.length, ResourceUtils.getSubResources(rootPath, path, true).length); System.out.println(path + " <--> string(size):" + subs.length); for (String sub : subs) { System.out.println("string:" + sub); } }