find and copy files
This commit is contained in:
@@ -39,12 +39,17 @@ public class FindAndCopyFilesFromList {
|
||||
else {
|
||||
files++;
|
||||
if (lines.contains(file.getName())) {
|
||||
FileUtils.copyFile(file, new File(targetDir));
|
||||
log.info("Copy '" + file.getPath() + "' to '" + targetDir );
|
||||
FileUtils.copyFile(file, new File(targetDir, file.getName()));
|
||||
copiedFiles++;
|
||||
lines.remove(file.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("Copied " + copiedFiles + " files from " + dirs + " directories with " + files + " files.");
|
||||
System.out.println("Could not find the following files:");
|
||||
for (String name : lines)
|
||||
System.out.println(" " + name);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Reference in New Issue
Block a user