code: static void copyDirectory(File sourceDirectory, File targetDirectory) throws IOException {
  
  		final Path sourcePath = Paths.get(sourceDirectory.toURI()).toRealPath();
  		final Path targetPath = Paths.get(targetDirectory.toURI());
  
  		Files.walkFileTree(sourcePath, new SimpleFileVisitor<Path>() {
  			@Override
  			public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
  				Path relative = sourcePath.relativize(dir);
  				Path target = targetPath.resolve(relative);
  				File folder = target.toFile();
  				if (!folder.exists()) {
  					mkdirs(folder);
  				}
  				return FileVisitResult.CONTINUE;
  			}
  
  			@Override
  			public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
  				Path relative = sourcePath.relativize(file);
  				Path target = targetPath.resolve(relative);
  				Files.copy(file, target, StandardCopyOption.COPY_ATTRIBUTES);
  				return FileVisitResult.CONTINUE;
  			}
  		});
  	}
docs: Copies directories, preserving file attributes.
  <p>
  The {@link org.zeroturnaround.zip.commons.FileUtilsV2_2#copyDirectory(File, File)} function does not
  preserve file attributes.