Path targetPath = Paths.get($file.getPath());
Path sourcePath = Paths.get(files[i].getPath());
Files.copy(sourcePath, targetPath, StandardCopyOption.REPLACE_EXISTING);
Path targetPath = Paths.get($file.getPath());
Path sourcePath = Paths.get(files[i].getPath());
Files.copy(sourcePath, targetPath, StandardCopyOption.REPLACE_EXISTING);