Here you can find the source of getTempDirectory()
public static File getTempDirectory()
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { public static File getTempDirectory() { File tempDirectory = null; String property = "java.io.tmpdir"; String tempDirectoryAsString = System.getProperty(property); if (tempDirectoryAsString != null) { tempDirectory = new File(tempDirectoryAsString); }//from w w w . j ava2 s .co m return tempDirectory; } }