Here you can find the source of deleteFolder(String path)
public static void deleteFolder(String path)
//package com.java2s; //License from project: LGPL import java.io.File; public class Main { public static void deleteFolder(String path) { deleteFolder(new File(path)); }/* ww w . ja v a 2s. c o m*/ public static void deleteFolder(File dir) { if (dir.isDirectory()) { String[] children = dir.list(); for (int i = 0; i < children.length; i++) deleteFolder(new File(dir, children[i])); } dir.delete(); } }