示例#1
0
 public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs)
     throws IOException {
   if (m != null) m.reset(root.relativize(dir).toString());
   return m == null || m.matches() || m.hitEnd()
       ? FileVisitResult.CONTINUE
       : FileVisitResult.SKIP_SUBTREE;
 }
示例#2
0
 public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
   if (attrs.isRegularFile()) {
     if (m != null) m.reset(root.relativize(file).toString());
     if (m == null || m.matches())
       futures.add(exec.submit(new FileLoader(root, file, blocSize)));
   }
   return FileVisitResult.CONTINUE;
 }