I have been writing a program for batch system using quartz and i find a problem,
if(!file.renameTo(new File(PATH_FILE_PROCESSED+file.getName())))System.out.println("Cannot Move File :"+file.getAbsolutePath());
else{
if(!file.delete())System.out.println("Cannot Delete File :"+file.getAbsolutePath());
}
i want to move file from one directory to another directory but i can't delete the file in the same process, from my analysis i think the file haven't finished copying then running the file.delete(); my question is, is there a way to wait until the file finished copying then run the file.delete? thanks