@CanIgnoreReturnValue
  public DirectoryEntry requireDirectory(Path pathForException)
      throws NoSuchFileException, NotDirectoryException {
    requireExists(pathForException);
    if (!file().isDirectory()) {
      throw new NotDirectoryException(pathForException.toString());
    }
    return this;
  }
Checks that this entry exists and links to a directory, throwing an exception if not.

@return this
@throws NoSuchFileException if this entry does not exist
@throws NotDirectoryException if this entry does not link to a directory
jimfs/src/main/java/com/google/common/jimfs/DirectoryEntry.java