Here you can find the source of deletePathRecursive(File path)
public static boolean deletePathRecursive(File path)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static boolean deletePathRecursive(File path) { if (path.isDirectory()) { for (File file : path.listFiles()) { if (!deletePathRecursive(file)) return false; }/*from w w w .j a v a2 s .co m*/ } return path.delete(); } }