Here you can find the source of getTempFile(String extension)
public static File getTempFile(String extension)
//package com.java2s; /******************************************************************************* * Copyright (c) 2009-2012, University of Manchester * /* w w w . j a va 2 s.com*/ * Licensed under the New BSD License. * Please see LICENSE file that is distributed with the source code ******************************************************************************/ import java.io.File; import java.util.UUID; public class Main { public static File getTempFile(String extension) { File tmpDir = new File(System.getProperty("java.io.tmpdir")); String uuid = UUID.randomUUID().toString(); return new File(tmpDir, uuid + "." + extension); } }