code: public void syncPersistNewDirectory(MutableInodeDirectory dir)
        throws InvalidPathException, FileDoesNotExistException, IOException {
      dir.setPersistenceState(PersistenceState.TO_BE_PERSISTED);
      syncPersistDirectory(dir).ifPresent(status -> {
        // If the directory already exists in the UFS, update our metadata to match the UFS.
        dir.setOwner(status.getOwner())
            .setGroup(status.getGroup())
            .setMode(status.getMode());
  
        Long lastModificationTime = status.getLastModifiedTime();
        if (lastModificationTime != null) {
          dir.setLastModificationTimeMs(lastModificationTime, true);
        }
      });
      dir.setPersistenceState(PersistenceState.PERSISTED);
    }
docs: Synchronously persists an inode directory to the UFS.
  
  This method does not handle concurrent modification to the given inode, so the inode must not
  yet be added to the inode tree.
  
  @param dir the inode directory to persist