Here you can find the source of deleteFolder(String path)
public static boolean deleteFolder(String path)
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static boolean deleteFolder(String path) { return deleteFolder(new File(path)); }/*from w w w. java 2 s . co m*/ public static boolean deleteFolder(File file) { if (file.isDirectory()) { for (File other : file.listFiles()) { if (!deleteFolder(other.getPath())) return false; } if (!file.delete()) return false; } else { if (!file.delete()) return false; } return true; } }