code: protected static void deleteDir(File dir) {
  
          String files[] = dir.list();
          if (files == null) {
              files = new String[0];
          }
          for (int i = 0; i < files.length; i++) {
              File file = new File(dir, files[i]);
              if (file.isDirectory()) {
                  deleteDir(file);
              } else {
              	try {
              		file.delete();
              	} catch (SecurityException se) {
              		log.error("The file " + file.getAbsolutePath() + " couldn't be deleted");
              	}
              }
          }
          try {
          	dir.delete();
          } catch (SecurityException se) {
      		log.error("The directory " + dir.getAbsolutePath() + " couldn't be deleted");
      	}
      }
docs: Delete the specified directory, including all of its contents and
  subdirectories recursively.
  
  @param dir File object representing the directory to be deleted