GH-56: Upgrade to SC-AWS-1.2 RC1

Fixes: spring-projects/spring-integration-aws#56

The upgrade to SC-AWS-1.2 RC1 resolves US_East_2 Region concern
since AWS SDK is polled in version `1.1.98`

Also fix deprecation warnings in S3 support components
This commit is contained in:
Artem Bilan
2017-03-30 14:42:07 -04:00
parent b552a0892c
commit c8195fb9b5
3 changed files with 17 additions and 8 deletions

View File

@@ -37,7 +37,7 @@ ext {
assertjVersion = '3.6.2'
servletApiVersion = '3.1.0'
slf4jVersion = '1.7.22'
springCloudAwsVersion = '1.1.3.RELEASE'
springCloudAwsVersion = '1.2.0.RC1'
springIntegrationVersion = '4.3.8.RELEASE'
idPrefix = 'aws'

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016 the original author or authors.
* Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -50,6 +50,7 @@ import com.amazonaws.services.s3.transfer.ObjectMetadataProvider;
import com.amazonaws.services.s3.transfer.PersistableTransfer;
import com.amazonaws.services.s3.transfer.Transfer;
import com.amazonaws.services.s3.transfer.TransferManager;
import com.amazonaws.services.s3.transfer.TransferManagerBuilder;
import com.amazonaws.services.s3.transfer.internal.S3ProgressListener;
import com.amazonaws.services.s3.transfer.internal.S3ProgressListenerChain;
import com.amazonaws.util.Md5Utils;
@@ -130,12 +131,20 @@ public class S3MessageHandler extends AbstractReplyProducingMessageHandler {
}
public S3MessageHandler(AmazonS3 amazonS3, String bucket, boolean produceReply) {
this(new TransferManager(amazonS3), bucket, produceReply);
this(TransferManagerBuilder.standard()
.withS3Client(amazonS3)
.build(),
bucket,
produceReply);
Assert.notNull(amazonS3, "'amazonS3' must not be null");
}
public S3MessageHandler(AmazonS3 amazonS3, Expression bucketExpression, boolean produceReply) {
this(new TransferManager(amazonS3), bucketExpression, produceReply);
this(TransferManagerBuilder.standard()
.withS3Client(amazonS3)
.build(),
bucketExpression,
produceReply);
Assert.notNull(amazonS3, "'amazonS3' must not be null");
}
@@ -319,7 +328,7 @@ public class S3MessageHandler extends AbstractReplyProducingMessageHandler {
if (metadata.getContentMD5() == null) {
Assert.state(inputStream.markSupported(),
"For an upload InputStream with no MD5 digest metadata, the " +
"markSupported() method must evaluate to true. ");
"markSupported() method must evaluate to true. ");
String contentMd5 = Md5Utils.md5AsBase64(inputStream);
metadata.setContentMD5(contentMd5);
inputStream.reset();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016 the original author or authors.
* Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@ import org.springframework.integration.file.remote.session.SharedSessionCapable;
import org.springframework.util.Assert;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.services.s3.model.S3ObjectSummary;
/**
@@ -37,7 +37,7 @@ public class S3SessionFactory implements SessionFactory<S3ObjectSummary>, Shared
private final S3Session s3Session;
public S3SessionFactory() {
this(new AmazonS3Client());
this(AmazonS3ClientBuilder.defaultClient());
}
public S3SessionFactory(AmazonS3 amazonS3) {