Here you can find the source of deleteTempFiles()
public static void deleteTempFiles()
//package com.java2s; import java.io.File; import java.util.ArrayList; public class Main { /** Used to track temp files, per thread */ private static ThreadLocal<ArrayList<File>> tempFiles = new ThreadLocal<ArrayList<File>>(); /**/*from w ww . jav a2 s . c om*/ * Deletes all temporary files created by the current thread using * {@link #createTempFile}. */ public static void deleteTempFiles() { ArrayList<File> files = tempFiles.get(); if (files != null) { for (File f : files) f.delete(); files.clear(); tempFiles.set(null); } } }