Here you can find the source of removeableFile(File folder, String fileName)
private static File removeableFile(File folder, String fileName)
//package com.java2s; import java.io.File; public class Main { private static File removeableFile(File folder, String fileName) { File file = new File(folder, fileName); file.deleteOnExit();/*from w w w . j a v a 2 s. c o m*/ return file; } }