title: Check if file move succeeded by Files from java nio
body: <p>I need to move files from one location to another on the unix box and I am using the below code to perform the move:</p>
  
  <pre><code>Path sourcePath = Paths.get(infaFileOut);
  Path destinationPath = Paths.get(fileOut);
  Files.move(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING);
  </code></pre>
  
  <p>Once the file is in the destination, I need to do some additional processing. I am making the code sleep for 10 sec so that before the processing starts, the move should have already been completed. Is there any better way to make sure the move succeeded before the rest of the code runs?</p>