Skip to content

Commit 55ee9c2

Browse files
committed
The AWS SDK Java v2 HeadObject.restore() is not reliable as of version 2.8.5, see aws/aws-sdk-java-v2#670 (comment)
1 parent a6646f0 commit 55ee9c2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/org/broad/igv/aws/S3LoadDialog.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ private boolean isObjectAccessible(Triple S3Obj) {
210210

211211
HeadObjectResponse S3Meta;
212212
boolean ObjAvailable;
213-
String objCurrentState = "";
213+
String objCurrentState;
214214

215215
if (S3ObjectStorageClass.contains("DEEP_ARCHIVE") ||
216216
S3ObjectStorageClass.contains("GLACIER")) {
@@ -225,7 +225,8 @@ private boolean isObjectAccessible(Triple S3Obj) {
225225

226226
//https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/s3/model/HeadObjectResponse.html#restore--
227227
S3Meta = AmazonUtils.getObjectMetadata(S3Obj);
228-
objCurrentState = S3Meta.restore();
228+
//objCurrentState = S3Meta.restore();
229+
objCurrentState = S3Meta.sdkHttpResponse().headers().get("x-amz-restore").toString();
229230

230231
if(objCurrentState == null) {
231232
ObjAvailable = false;

0 commit comments

Comments
 (0)