If you have to get a systems temporary directory for example to store some property files, you could use the following code.

Source Code

1
String tmpDir = System.getProperty("java.io.tmpdir");

By my experience, the resulting String will already include the operating specific path separator.