182183184185186187188189190191192
if (null == f || f.isDirectory()) { list.addAll(scan(path, regex)); } // 普通磁盘文件 else if (f.isFile()) { list.add(new FileResource(f)); } // 存放在 jar 中的文件 else if (isInJar(f)) { NutResource nutResource = makeJarNutResource(f); if (nutResource != null) {
176177178179180181182183184185186
if (srcFile.isDirectory()) { Disks.visitFile(srcFile, new ResourceFileVisitor(list, src), new ResourceFileFilter(pattern)); } else { list.add(new FileResource(src, srcFile)); } } else scan(src.substring(1), regex); //虽然已经找到一些了, 但还是扫描一些吧,这样才全!!
399400401402403404405
} } public static class ResourceFileVisitor implements FileVisitor { public void visit(File f) { list.add(new FileResource(base, f)); }
7879808182838485868788
for (String path : paths) { List<NutResource> resources; if (path.endsWith(".js")) { File f = Files.findFile(path); resources = new ArrayList<NutResource>(); resources.add(new FileResource(f)); } else { resources = Scans.me().scan(path, "\\.js$"); } for (NutResource nr : resources) {
177178179180181182183184185186187
408409410411412413414
7576777879808182838485