File.renameTo fails over NFS mounts so I'm using the commons.io FileUtils class's moveFile method. Occasionally it throws an IOException when moving a file however that file correctly shows up in the NFS mount. I'm assuming there is a race condition between when FileUtils checks to make sure the file was moved and NFS saying that's a valid file.
What is the best way to ensure a smooth file move over to an NFS mount in Java?
File f = new File("test.log");
FileUtils.moveFile(f, new File(newDir, f.getName));