Here you can find the source of getTempFolder()
public static File getTempFolder()
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { private static volatile File tempFolder = null; private static final Integer LOCK = 0; public static File getTempFolder() { if (tempFolder == null) { synchronized (LOCK) { if (tempFolder == null) { try { File tempFile = File.createTempFile("IOUtil", "tmp"); tempFolder = tempFile.getParentFile(); tempFile.delete(); } catch (IOException ex) { ex.printStackTrace(); }/*from www . ja va 2 s . c o m*/ } } } return tempFolder; } public static File createTempFile(String fileName) { try { return File.createTempFile("IOUtil", fileName); } catch (IOException ex) { throw new RuntimeException(ex); } } }