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.