@Override
  public boolean isEmptyDirectory(String location) {
    Preconditions.checkArgument(
        isDirectory(location), "the target location %s is not a directory", location);
    return tableMetaStore.doAs(
        () -> {
          Path path = new Path(location);
          FileSystem fs = getFs(path);
          try {
            RemoteIterator<LocatedFileStatus> fileStatuses = fs.listFiles(path, true);
            return !fileStatuses.hasNext();
          } 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