All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.snowflake.client.jdbc.cloud.storage.GcsObjectSummariesIterator Maven / Gradle / Ivy

There is a newer version: 3.19.0
Show newest version
/*
 * Copyright (c) 2012-2019 Snowflake Computing Inc. All rights reserved.
 */
package net.snowflake.client.jdbc.cloud.storage;

import com.google.api.gax.paging.Page;
import com.google.cloud.storage.Blob;

import java.util.Iterator;

/**
 * Iterator class for ObjectSummary objects on GCS objects.
 * Returns platform-independent instances (StorageObjectSummary)
 *
 * @author ppaulus
 */
public class GcsObjectSummariesIterator implements Iterator
{
  private final Iterator blobIterator;

  public GcsObjectSummariesIterator(Page blobs)
  {
    this.blobIterator = blobs.iterateAll().iterator();
  }

  @Override
  public boolean hasNext()
  {
    return this.blobIterator.hasNext();
  }

  @Override
  public StorageObjectSummary next()
  {
    Blob blob = this.blobIterator.next();
    return StorageObjectSummary.createFromGcsBlob(blob);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy