Here you can find the source of deleteFile(File f)
public static void deleteFile(File f)
//package com.java2s; import java.io.File; public class Main { public static void deleteFile(File f) { if (f.isDirectory()) { for (File f2 : f.listFiles()) deleteFile(f2);/*from w w w. j a v a 2 s. c o m*/ } if (!f.delete()) throw new RuntimeException("Unable to delete file: " + f); } }