1 Answer
- Newest
- Most votes
- Most comments
0
Hi Mark,
Yes, data is still available.
You can get version id by us issuing a headObject method call (https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/s3/S3Client.html#headObject(java.util.function.Consumer)).
The object needs to exists before you can call the method so first you ll need to PUT it and then execute the HEAD call.
It’s response, HeadObjectResponse, will contain the version Id:
Hope it clarifies
Relevant content
- asked 2 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 10 months ago
I know I can make a second call, but that's not what I want.
In v1 I can get the version in the response of the PubObject. If I've got to do a second call, there's no guarantee that I'm going to get the version of what I just uploaded if someone else uploads with the same key in the mean time.
The only ways I see is either as described above, or actually, according to https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html, the response object contains a header field called: x-amz-version-id, the Version of the object. Let me know if it gives you the right value