Reputation: 645
Google Storage documentation tells about Object Versioning. There are two kinds of the object versions: live and noncurrent.
gsutil
allow listing both noncurrent and live versions using -a
switch: https://cloud.google.com/storage/docs/using-object-versioning#list.
Also, I can list all the versions programmatically by supplying versions: true
option to the Bucket.getFiles
method.
However I have not found any way to programmatically find out whether a particular object version is live or noncurrent. There seems to be no property or method in the File object for this.
What is the proper way of finding this out given a File
instance?
Upvotes: 2
Views: 1754
Reputation: 75820
By looking at the REST API, there isn't a state for the live/noncurrent version of the objects. You have a generation number per object resource representation.
I assume that you have to apply yourselves an algorithm for this
Upvotes: 3