class Helpers {

    public static void copyPath(Path source, Path destination) throws IOException {
        Files.walkFileTree(source, new SimpleFileVisitor<Path>() {
            @Override
            public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs)
                    throws IOException
            {
                Path destinationDir = destination.resolve(source.relativize(dir));
                try {
                    Files.copy(dir, destinationDir);
                } catch (FileAlreadyExistsException e) {
                    if (!Files.isDirectory(destinationDir))
                        throw e;
                }
                return CONTINUE;
            }
            @Override
            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
                    throws IOException
            {
                Files.copy(file, destination.resolve(source.relativize(file)));
                return CONTINUE;
            }
        });
    }

}