title: Alternative to File.deleteOnExit() in Java NIO?
body: <p>Java IO has <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html#deleteOnExit()" rel="noreferrer">File.deleteOnExit()</a>, which is a method that deletes the file it is called on during normal termination of the JVM. I've found this to be very useful for cleaning up temporary files, especially during unit tests.</p>
  
  <p>However, I don't see a method by the same name in Java NIO's <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html" rel="noreferrer">Files</a> class. I am aware that I can do <code>path.toFile().deleteOnExit()</code>, but I'd like to know if there is an alternative using NIO.</p>
  
  <p>Is there an alternative? If not, why is there not one?</p>