Here you can find the source of deleteR(File dir)
public static void deleteR(File dir)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static void deleteR(File dir) { deleteR(dir, true);//from w ww . ja v a 2 s .co m } private static void deleteR(File file, boolean deleteRoot) { File[] listFiles = file.listFiles(); if (listFiles != null) { for (File child : listFiles) { deleteR(child, true); } } if (deleteRoot) { file.delete(); } } }