Java tutorial
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static void DeleteRecursive(File fileOrDirectory) { boolean bool; if (fileOrDirectory.isDirectory()) for (File child : fileOrDirectory.listFiles()) { bool = child.delete(); System.out.println(" deleted folder contents > result : " + bool); DeleteRecursive(child); } bool = fileOrDirectory.delete(); System.out.println(" deleted folder > result : " + bool); } }