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; }
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; }
public FileDesc call() throws Exception { return loadFile(root, root.relativize(file), blocSize); }