code: public static boolean deleteFileOrDir( File filehandle ) {
  
          if (filehandle.isDirectory()) {
              String[] children = filehandle.list();
              for( int i = 0; i < children.length; i++ ) {
                  boolean success = deleteFileOrDir(new File(filehandle, children[i]));
                  if (!success) {
                      return false;
                  }
              }
          }
  
          // The directory is now empty so delete it
          boolean isdel = filehandle.delete();
          if (!isdel) {
              // if it didn't work, which often happens on windows systems,
              // remove on exit
              filehandle.deleteOnExit();
          }
  
          return isdel;
      }
docs: Returns true if all deletions were successful. If a deletion fails, the method stops
  attempting to delete and returns false.
  
  @param filehandle
  @return true if all deletions were successful