Here you can find the source of deleteDirs(File path)
private static void deleteDirs(File path)
//package com.java2s; import java.io.File; public class Main { private static void deleteDirs(File path) { File[] files = null;/*from w w w . java 2 s . c om*/ if (path.isDirectory()) { path.delete(); files = path.listFiles(); if (files != null) { for (int i = 0; i < files.length; i++) { deleteDirs(files[i]); } } } path.delete(); } }