As discussed in this RFE and its comments, you could call tempDir.delete()
first. Or you could use System.getProperty("java.io.tmpdir")
and create a directory there. Either way, you should remember to call tempDir.deleteOnExit()
, or the file won't be deleted after you're done.