Here you can find the source of deleteRecursively(File fileOrDir)
public static void deleteRecursively(File fileOrDir)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static void deleteRecursively(File fileOrDir) { if (fileOrDir.isDirectory()) for (File f : fileOrDir.listFiles()) deleteRecursively(f);/* w w w.ja v a 2s . c om*/ fileOrDir.delete(); } }