Here you can find the source of removerDiretorio(File dir)
public static boolean removerDiretorio(File dir)
//package com.java2s; import java.io.File; public class Main { public static boolean removerDiretorio(File dir) { if (dir.isDirectory()) { String[] children = dir.list(); for (int i = 0; i < children.length; i++) { boolean success = removerDiretorio(new File(dir, children[i]));/*from w w w. ja v a 2s.c o m*/ if (!success) { return false; } } } return dir.delete(); } }