Here you can find the source of deleteDirectory(String path)
public static boolean deleteDirectory(String path)
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static boolean deleteDirectory(String path) { return deleteDirectory(new File(path)); }//ww w . j a v a 2s . c o m public static boolean deleteDirectory(File path) { if (path.isDirectory()) { for (File file : path.listFiles()) { deleteDirectory(file); } } return path.delete(); } public static boolean delete(String name) { File was_file = new File(name); System.err.println("[IOUtils] deleting: " + was_file.getAbsolutePath()); return was_file.delete(); } }