1

How do I get a list of archived versions of a file via gcloud-java? I don't see an option in Bucket.list(), is there somewhere else I should be looking?

dimo414
  • 47,227
  • 18
  • 148
  • 244

1 Answers1

1

If version is enabled for the bucket then listing should return all the available versions (BlobId includes the version). Do you experience a different behavior?

ozarov
  • 1,051
  • 6
  • 7
  • `Bucket.list()`, by default, returns archived versions? That seems confusing. I'll double-check, but I don't *think* that was the behavior I was seeing. – dimo414 Feb 29 '16 at 18:33
  • Including all versions in listing is enabled by [default](https://cloud.google.com/storage/docs/json_api/v1/objects/list). It looks like BlobListOptions is missing a way to change it. I created this [issue](https://github.com/GoogleCloudPlatform/gcloud-java/issues/687) to fix that. – ozarov Feb 29 '16 at 22:44
  • Actually I think you are right. I think I read the comment "lists all versions of an object as distinct results" backwards (focusing on the **distinct** part). In any case, we should be able to resolve the issue soon and support a way to specify it. – ozarov Feb 29 '16 at 22:56
  • Thanks, you [beat me to the punch](https://github.com/GoogleCloudPlatform/gcloud-java/issues/687) :) – dimo414 Mar 01 '16 at 07:27