I have completed the logic copy to dest folder and then delete the source folder after successfully copied. here is my code,
File[] directories = new File("E:\\shareFolder")
.listFiles(file -> file.isDirectory() && file.getName().matches("[0-9]{6}"));
for (File getDirectory : directories) {
try {
FileUtils.copyDirectory(new File(getDirectory.getAbsolutePath()),new File("F:\\localFolder"));
// here i will check both file size are same if same
FileUtils.forceDelete(new File(getDirectory.getAbsolutePath());
} catch (IOException e) {
e.printStackTrace();
}
}
But now the requirement changed to access the source folder remotely(E://shareFolder to \45.xx.88.xx\shareFolder).
How can achieve existing all condition by access remote folder ?