Exemple #1
0
 public static void deleteFolder(File folder) {
   File[] files = folder.listFiles();
   if (files != null) { // some JVMs return null for empty dirs
     for (File f : files) {
       if (f.isDirectory()) {
         deleteFolder(f);
       } else {
         f.delete();
       }
     }
   }
   folder.delete();
 }
Exemple #2
0
 public static void delete(String path) {
   deleteFolder(new File(path));
 }