[ https://issues.apache.org/jira/browse/OODT-993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16599340#comment-16599340 ]
ASF GitHub Bot commented on OODT-993: ------------------------------------- chrismattmann closed pull request #72: OODT-993 Upgrade aws-java-sdk dependency and address deprecated api usage URL: https://github.com/apache/oodt/pull/72 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/core/pom.xml b/core/pom.xml index 69bf75272..fa86caa3e 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -72,7 +72,7 @@ the License. <dependency> <groupId>com.amazonaws</groupId> <artifactId>aws-java-sdk</artifactId> - <version>1.7.4</version> + <version>1.11.396</version> </dependency> <dependency> <groupId>org.apache.avro</groupId> diff --git a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/datatransfer/S3DataTransferer.java b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/datatransfer/S3DataTransferer.java index e7f9385c7..28471639b 100644 --- a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/datatransfer/S3DataTransferer.java +++ b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/datatransfer/S3DataTransferer.java @@ -70,7 +70,7 @@ public void transferProduct(Product product) throws DataTransferException, IOExc bucketName, dataStoreRef, new File(origRef)); if (encrypt) { ObjectMetadata requestMetadata = new ObjectMetadata(); - requestMetadata.setServerSideEncryption(AES_256_SERVER_SIDE_ENCRYPTION); + requestMetadata.setSSEAlgorithm(AES_256_SERVER_SIDE_ENCRYPTION); request.setMetadata(requestMetadata); } s3Client.putObject(request); diff --git a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/datatransfer/S3DataTransfererFactory.java b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/datatransfer/S3DataTransfererFactory.java index d87dd3763..86fc9703d 100644 --- a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/datatransfer/S3DataTransfererFactory.java +++ b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/datatransfer/S3DataTransfererFactory.java @@ -16,10 +16,10 @@ */ package org.apache.oodt.cas.filemgr.datatransfer; +import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.BasicAWSCredentials; -import com.amazonaws.regions.Region; -import com.amazonaws.regions.Regions; import com.amazonaws.services.s3.AmazonS3Client; +import com.amazonaws.services.s3.AmazonS3ClientBuilder; /** * {@link DataTransferFactory} which creates {@link S3DataTransferer}s. @@ -47,8 +47,12 @@ public S3DataTransferer createDataTransfer() { String secretKey = System.getProperty(SECRET_KEY_PROPERTY); boolean encrypt = Boolean.getBoolean(ENCRYPT_PROPERTY); - AmazonS3Client s3 = new AmazonS3Client(new BasicAWSCredentials(accessKey, secretKey)); - s3.setRegion(Region.getRegion(Regions.valueOf(region))); + AmazonS3Client s3 = (AmazonS3Client) AmazonS3ClientBuilder.standard() + .withRegion(region) + .withCredentials( + new AWSStaticCredentialsProvider( + new BasicAWSCredentials(accessKey, secretKey))) + .build(); return new S3DataTransferer(s3, bucketName, encrypt); } ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Upgrade aws-java-sdk dependency and address deprecated api usage > ---------------------------------------------------------------- > > Key: OODT-993 > URL: https://issues.apache.org/jira/browse/OODT-993 > Project: OODT > Issue Type: Improvement > Components: file manager > Affects Versions: 1.9 > Reporter: Lewis John McGibbney > Assignee: Lewis John McGibbney > Priority: Major > Fix For: 1.9 > > > Small but important patch for upgrading the AWS s3 SDK dependency. Patch > coming up. -- This message was sent by Atlassian JIRA (v7.6.3#76005)