Where can I store temporary files?

John Zukowski

The java.io.tmpdir system property defines an appropriate area:

String tempPath = System.getProperty("java.io.tmpdir");
File f = new File(tempPath, "test.out");
From Davanum Srinivas:

One more alternative is to use File.createTempFile() as follows:

File f = File.createTempFile("TMP","DAT");
See How do I create a temporary file? for more info.
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact