@Test public void visitFileNormalFile() throws IOException { CopyFileVisitor visitor = new CopyFileVisitor(fromFolder, targetFolder); FileVisitResult fileVisitResult = visitor.visitFile(normalFile.toPath(), basicFileAttributesMock); assertThat(fileVisitResult, is(CONTINUE)); }
@Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (exclusionMatcher.matches(file) || (ignoreHiddenFiles && file.toFile().isHidden())) { return FileVisitResult.SKIP_SUBTREE; } Files.copy(file, targetFolder.toPath().resolve(fromFolder.toPath().relativize(file)), StandardCopyOption.REPLACE_EXISTING); return FileVisitResult.CONTINUE; }
CopyFileVisitor implements FileVisitor<Path> { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (exclusionMatcher.matches(file) || (ignoreHiddenFiles && file.toFile().isHidden())) { return FileVisitResult.SKIP_SUBTREE; } Files.copy(file, targetFolder.toPath().resolve(fromFolder.toPath().relativize(file)), StandardCopyOption.REPLACE_EXISTING); return FileVisitResult.CONTINUE; } }
CopyFileVisitor implements FileVisitor<Path> { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (exclusionMatcher.matches(file) || (ignoreHiddenFiles && file.toFile().isHidden())) { return FileVisitResult.SKIP_SUBTREE; } Files.copy(file, targetFolder.toPath().resolve(fromFolder.toPath().relativize(file)), StandardCopyOption.REPLACE_EXISTING); return FileVisitResult.CONTINUE; } CopyFileVisitor(File fromFolder, File targetFolder);  CopyFileVisitor(File fromFolder, File targetFolder, Boolean ignoreHiddenFiles, Boolean ignoreHiddenFolders);  CopyFileVisitor(File fromFolder, File targetFolder, Boolean ignoreHiddenFiles, Boolean ignoreHiddenFolders,
                         PathMatcher exclusionMatcher); }
CopyFileVisitor implements FileVisitor<Path> { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (exclusionMatcher.matches(file) || (ignoreHiddenFiles && file.toFile().isHidden())) { return FileVisitResult.SKIP_SUBTREE; } Files.copy(file, targetFolder.toPath().resolve(fromFolder.toPath().relativize(file)), StandardCopyOption.REPLACE_EXISTING); return FileVisitResult.CONTINUE; } CopyFileVisitor(File fromFolder, File targetFolder);  CopyFileVisitor(File fromFolder, File targetFolder, Boolean ignoreHiddenFiles, Boolean ignoreHiddenFolders);  CopyFileVisitor(File fromFolder, File targetFolder, Boolean ignoreHiddenFiles, Boolean ignoreHiddenFolders,
                         PathMatcher exclusionMatcher); void setExclusions(List<Path> exclusions); @Override FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs); @Override FileVisitResult visitFile(Path file, BasicFileAttributes attrs); @Override FileVisitResult visitFileFailed(Path file, IOException exc); @Override FileVisitResult postVisitDirectory(Path dir, IOException exc); }
CopyFileVisitor implements FileVisitor<Path> { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (exclusionMatcher.matches(file) || (ignoreHiddenFiles && file.toFile().isHidden())) { return FileVisitResult.SKIP_SUBTREE; } Files.copy(file, targetFolder.toPath().resolve(fromFolder.toPath().relativize(file)), StandardCopyOption.REPLACE_EXISTING); return FileVisitResult.CONTINUE; } CopyFileVisitor(File fromFolder, File targetFolder);  CopyFileVisitor(File fromFolder, File targetFolder, Boolean ignoreHiddenFiles, Boolean ignoreHiddenFolders);  CopyFileVisitor(File fromFolder, File targetFolder, Boolean ignoreHiddenFiles, Boolean ignoreHiddenFolders,
                         PathMatcher exclusionMatcher); void setExclusions(List<Path> exclusions); @Override FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs); @Override FileVisitResult visitFile(Path file, BasicFileAttributes attrs); @Override FileVisitResult visitFileFailed(Path file, IOException exc); @Override FileVisitResult postVisitDirectory(Path dir, IOException exc);  }