Here you can find the source of forceDelete(File f)
public static void forceDelete(File f)
//package com.java2s; /*// w w w . j ava 2s . com * This file is subject to the license found in LICENCE.TXT in the root directory of the project. * * version 1.4 */ import java.io.File; public class Main { public static void forceDelete(File f) { if (f.isDirectory()) { File[] sub = f.listFiles(); for (int i = 0; i < sub.length; i++) { forceDelete(sub[i]); } } f.delete(); } }