Here you can find the source of deleteDirectory(File directory)
public static void deleteDirectory(File directory)
//package com.java2s; import java.io.File; public class Main { /**/* ww w . ja v a 2 s . com*/ * Deletes directory and its content */ public static void deleteDirectory(File directory) { for (File file : directory.listFiles()) { if (file.isDirectory()) deleteDirectory(file); else file.delete(); } directory.delete(); } }