Here you can find the source of recursiveDelete(final File path)
public static boolean recursiveDelete(final File path)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { /**// w ww . jav a 2 s . c om * Recursively delete the given path, stopping on the first error. */ public static boolean recursiveDelete(final File path) { if (path.isDirectory()) { String[] children = path.list(); if (children == null) { return false; } for (int i = 0; i < children.length; i++) { if (!recursiveDelete(new File(path, children[i]))) { return false; } } } return path.delete(); } }