code: public static boolean delete(String file) {
          File f = new File(file);
  
          if (f.isDirectory()) {
              // first insure the directory is empty
              String[] children = f.list();
              for (String child : children) {
                  if (!delete(Files.buildPath(file, child)))
                      return false;
              }
          }
  
          return f.delete();
      }
docs: Deletes file or recursively deletes a directory
  
  NOTE: this returns true if the file was actually deleted,  and false for 2 cases:
  1. file did not exist to start with
  2. File.delete() failed at some point for some reason
  
  use {@link #deleteOrDie(String)} instead if you want a clearer distinction between the 'falsy' responses
  
  @param file path to erase
  @return true if all deletions were successful. If a deletion fails, the method stops attempting to delete and returns false