Here you can find the source of doDeleteEmptyDir(String dir)
public static void doDeleteEmptyDir(String dir)
//package com.java2s; import java.io.File; public class Main { public static void doDeleteEmptyDir(String dir) { boolean success = (new File(dir)).delete(); if (success) { System.out.println("Successfully deleted empty directory: " + dir); } else {//from ww w.ja va 2 s . c o m System.out.println("Failed to delete empty directory: " + dir); } } }