Here you can find the source of getTempFileName()
public static String getTempFileName()
//package com.java2s; import java.io.File; import java.util.UUID; public class Main { public static String getTempFileName() { String tmpDir = System.getProperty("java.io.tmpdir"); if (tmpDir == null) { tmpDir = "/tmp"; }//w ww. j av a 2s .c o m String uuid = UUID.randomUUID().toString(); File f = new File(tmpDir, uuid); return f.getAbsolutePath(); } }