I move files via apache.commons.io, files were sorted in the array "moveList". When the files are sorted e. g. a.txt, b.txt, c.txt.... y.txt, z.txt, they are not moved in this given order. I think windows does the moving process, what means the first file that is moved is not a.txt, it is some file in the middle like n.txt.
Do you know a solution to start the moving process in the order I want it? Copying files is ok, moving files not.
for ( Object o : moveList ) {
Path p = Paths.get(o.toString());
String replaceFilePath = o.toString().replace(movePath.toString(), getTargetPath.toString()); // Tauscht getTargetPath mit movePath
File newTargetFile = Paths.get(replaceFilePath).toFile();
if (newTargetFile.exists() == false){
System.out.println("MOVE : " + p+" to "+newTargetFile);
FileUtils.moveFile(p.toFile(), newTargetFile);
}else{}
}