Here you can find the source of recursiveDelete(File file)
public static void recursiveDelete(File file)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.util.logging.Logger; public class Main { /**//from w w w .jav a2 s . co m * Recursivelly delete a file or directory */ public static void recursiveDelete(File file) { if (file != null) { if (file.isDirectory()) { for (File subFile : file.listFiles()) { recursiveDelete(subFile); } } if (!file.delete()) { Logger.global.info("Could not delete file " + file); } } } }