Here you can find the source of getTempDir()
public static String getTempDir()
//package com.java2s; public class Main { /**//from w ww .ja va2 s.co m * Returns the temp directory for this machine. */ public static String getTempDir() { String tempDir = System.getProperty("java.io.tmpdir"); if (!tempDir.endsWith(java.io.File.separator)) tempDir += java.io.File.separator; return tempDir; } }