Here you can find the source of recursiveDelete(File target)
public static boolean recursiveDelete(File target)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static boolean recursiveDelete(File target) { if (target.isDirectory()) { for (File f : target.listFiles()) recursiveDelete(f);//from w w w. j a v a 2 s. com } return target.delete(); } }