code: @Override
    public boolean delete(Path hadoopPath, boolean recursive) throws IOException {
      long startTime = System.nanoTime();
      Preconditions.checkArgument(hadoopPath != null, "hadoopPath must not be null");
  
      checkOpen();
  
      logger.atFine().log("GHFS.delete: %s, recursive: %s", hadoopPath, recursive);
      URI gcsPath = getGcsPath(hadoopPath);
      try {
        getGcsFs().delete(gcsPath, recursive);
      } catch (DirectoryNotEmptyException e) {
        throw e;
      } catch (IOException e) {
        // Occasionally log exceptions that have a cause at info level,
        // because they could surface real issues and help with troubleshooting
        (logger.atFine().isEnabled() || e.getCause() == null
            ? logger.atFine()
            : logger.atInfo().atMostEvery(5, TimeUnit.MINUTES))
            .withCause(e)
            .log("Failed GHFS.delete: %s, recursive: %s", hadoopPath, recursive);
        return false;
      }
  
      long duration = System.nanoTime() - startTime;
      increment(Counter.DELETE);
      increment(Counter.DELETE_TIME, duration);
      return true;
    }
docs: Deletes the given file or directory.
  
  @param hadoopPath The path to delete.
  @param recursive If path is a directory and set to
  true, the directory is deleted, else throws an exception.
  In case of a file, the recursive parameter is ignored.
  @return  true if delete is successful else false.
  @throws IOException if an error occurs.