@Override
  public Iterable<PathInfo> listDirectory(String location) {
    return tableMetaStore.doAs(
        () -> {
          Path path = new Path(location);
          FileSystem fs = getFs(path);
          try {
            FileStatus[] fileStatuses = fs.listStatus(path);
            Iterator<PathInfo> it =
                Stream.of(fileStatuses)
                    .map(
                        status ->
                            new PathInfo(
                                status.getPath().toString(),
                                status.getLen(),
                                status.getModificationTime(),
                                status.isDirectory()))
                    .iterator();
            return () -> it;
          } catch (IOException e) {
            throw new UncheckedIOException("Fail to list files in " + location, e);
          }
        });
  }
Implementation of {@link AuthenticatedFileIO} for hadoop file system with authentication.
amoro-format-iceberg/src/main/java/org/apache/amoro/io/AuthenticatedHadoopFileIO.java