Here you can find the source of getTempPath()
public static String getTempPath()
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.IOException; public class Main { /**/* w ww . ja v a 2 s .co m*/ * Create a temporary filename (for use as a file or directory) * * @return */ public static String getTempPath() { return getTempPath("ee-"); } /** * Create a temporary filename with the given prefix (for use as a file or directory) * * @param prefix * @return */ public static String getTempPath(String prefix) { try { File temp = File.createTempFile("ee-", ""); temp.delete(); return temp.getPath(); } catch (IOException e) { } return null; } }