1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
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
관련 콘텐츠
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 3년 전
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