From 7eee2da6d316bdcf7132f09e9f5bc6fcd317a08e Mon Sep 17 00:00:00 2001 From: u0028003 Date: Wed, 29 Nov 2023 14:29:36 -0700 Subject: [PATCH] Fixed an issue where the S3Copy app was attempting to restore "S3 Glacier Instant Retrieval" objects before downloading. This isn't needed. --- src/main/java/edu/utah/hci/aws/apps/copy/CopyJob.java | 6 ++++-- src/main/java/edu/utah/hci/aws/apps/copy/S3Copy.java | 4 +--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/edu/utah/hci/aws/apps/copy/CopyJob.java b/src/main/java/edu/utah/hci/aws/apps/copy/CopyJob.java index 3f1f6ed..fc603de 100644 --- a/src/main/java/edu/utah/hci/aws/apps/copy/CopyJob.java +++ b/src/main/java/edu/utah/hci/aws/apps/copy/CopyJob.java @@ -88,8 +88,10 @@ public String toString() { public String restoreCopy(CopyJobWorker cjw) throws Exception { if (complete) return "Complete"; - //does it need to be restored? archived? - if (source.getStorageClass().equals("STANDARD") == false) { + //does it need to be restored? GLACIER and DEEP_ARCHIVE only + String sc = source.getStorageClass(); + if (sc.equals("GLACIER") || sc.equals("DEEP_ARCHIVE")) { + //if (source.getStorageClass().equals("STANDARD") == false) { //pull meta data ObjectMetadata metaData = cjw.tryGetObjectMetadata(source.getBucketName(), source.getKey(), copyRequest.getSourceRegion()); diff --git a/src/main/java/edu/utah/hci/aws/apps/copy/S3Copy.java b/src/main/java/edu/utah/hci/aws/apps/copy/S3Copy.java index 7df64a0..9d3d383 100644 --- a/src/main/java/edu/utah/hci/aws/apps/copy/S3Copy.java +++ b/src/main/java/edu/utah/hci/aws/apps/copy/S3Copy.java @@ -15,8 +15,6 @@ import com.amazonaws.services.s3.AmazonS3ClientBuilder; import com.amazonaws.services.s3.iterable.S3Objects; import com.amazonaws.services.s3.model.AmazonS3Exception; -import com.amazonaws.services.s3.model.HeadBucketRequest; -import com.amazonaws.services.s3.model.HeadBucketResult; import com.amazonaws.services.s3.model.ObjectMetadata; import com.amazonaws.services.s3.model.S3ObjectSummary; import com.amazonaws.services.s3.model.Tier; @@ -534,7 +532,7 @@ public static void printDiffAccountInstructions() { public void printDocs(){ pl("\n" + "**************************************************************************************\n" + - "** S3 Copy : Feb 2023 **\n" + + "** S3 Copy : Nov 2023 **\n" + "**************************************************************************************\n" + "SC copies AWS S3 objects, unarchiving them as needed, within the same or different\n"+ "accounts or downloads them to your local computer. Run this as a daemon with -l or run\n"+