code: public boolean deleteOnExit(Path f) throws IOException {
      if (!exists(f)) {
        return false;
      }
      synchronized (deleteOnExit) {
        deleteOnExit.add(f);
      }
      return true;
    }
docs: Mark a path to be deleted when FileSystem is closed.
  When the JVM shuts down,
  all FileSystem objects will be closed automatically.
  Then,
  the marked path will be deleted as a result of closing the FileSystem.
  
  The path has to exist in the file system.
  
  @param f the path to delete.
  @return  true if deleteOnExit is successful, otherwise false.
  @throws IOException