Here you can find the source of deleteFileSystemDirectory(String dirPath)
public static void deleteFileSystemDirectory(String dirPath)
//package com.java2s; // Released under the terms of the GNU General Public License version 2 or later. import java.io.*; public class Main { public static void deleteFileSystemDirectory(String dirPath) { deleteFileSystemDirectory(new File(dirPath)); }//from w w w.j a v a2 s . c o m public static void deleteFileSystemDirectory(File current) { File[] files = current.listFiles(); for (int i = 0; files != null && i < files.length; i++) { File file = files[i]; if (file.isDirectory()) deleteFileSystemDirectory(file); else file.delete(); } current.delete(); } }