You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/03/20 14:48:39 UTC
[camel] 03/03: CAMEL-14658 - Provide a simpler way to connect to a
local s3 instance, Fixed CS
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit d560772f1551a25e104bcfb8eabdd4265c5da6d2
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Mar 20 15:47:05 2020 +0100
CAMEL-14658 - Provide a simpler way to connect to a local s3 instance, Fixed CS
---
.../org/apache/camel/component/aws/s3/S3Configuration.java | 12 ++++++------
.../java/org/apache/camel/component/aws/s3/S3Producer.java | 2 +-
.../aws/s3/client/impl/S3ClientIAMOptimizedImpl.java | 4 ++--
.../component/aws/s3/client/impl/S3ClientStandardImpl.java | 8 ++++----
.../camel/component/aws/s3/S3ComponentConfigurationTest.java | 2 +-
.../integration/S3ObjectRangeOperationIntegrationTest.java | 2 +-
6 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/components/camel-aws-s3/src/main/java/org/apache/camel/component/aws/s3/S3Configuration.java b/components/camel-aws-s3/src/main/java/org/apache/camel/component/aws/s3/S3Configuration.java
index dc9215c..f5892fd 100644
--- a/components/camel-aws-s3/src/main/java/org/apache/camel/component/aws/s3/S3Configuration.java
+++ b/components/camel-aws-s3/src/main/java/org/apache/camel/component/aws/s3/S3Configuration.java
@@ -146,17 +146,17 @@ public class S3Configuration implements Cloneable {
}
public EndpointConfiguration getEndpointConfiguration() {
- return endpointConfiguration;
- }
+ return endpointConfiguration;
+ }
/**
* Amazon AWS Endpoint Configuration
*/
- public void setEndpointConfiguration(EndpointConfiguration endpointConfiguration) {
- this.endpointConfiguration = endpointConfiguration;
- }
+ public void setEndpointConfiguration(EndpointConfiguration endpointConfiguration) {
+ this.endpointConfiguration = endpointConfiguration;
+ }
- public AmazonS3 getAmazonS3Client() {
+ public AmazonS3 getAmazonS3Client() {
return amazonS3Client;
}
diff --git a/components/camel-aws-s3/src/main/java/org/apache/camel/component/aws/s3/S3Producer.java b/components/camel-aws-s3/src/main/java/org/apache/camel/component/aws/s3/S3Producer.java
index b4f8c63..488e02f 100644
--- a/components/camel-aws-s3/src/main/java/org/apache/camel/component/aws/s3/S3Producer.java
+++ b/components/camel-aws-s3/src/main/java/org/apache/camel/component/aws/s3/S3Producer.java
@@ -186,7 +186,7 @@ public class S3Producer extends DefaultProducer {
partSize = Math.min(partSize, contentLength - filePosition);
UploadPartRequest uploadRequest = new UploadPartRequest().withBucketName(getConfiguration().getBucketName()).withKey(keyName)
- .withUploadId(initResponse.getUploadId()).withPartNumber(part).withFileOffset(filePosition).withFile(filePayload).withPartSize(partSize);
+ .withUploadId(initResponse.getUploadId()).withPartNumber(part).withFileOffset(filePosition).withFile(filePayload).withPartSize(partSize);
LOG.trace("Uploading part [{}] for {}", part, keyName);
partETags.add(getEndpoint().getS3Client().uploadPart(uploadRequest).getPartETag());
diff --git a/components/camel-aws-s3/src/main/java/org/apache/camel/component/aws/s3/client/impl/S3ClientIAMOptimizedImpl.java b/components/camel-aws-s3/src/main/java/org/apache/camel/component/aws/s3/client/impl/S3ClientIAMOptimizedImpl.java
index abb5128..26b3624 100644
--- a/components/camel-aws-s3/src/main/java/org/apache/camel/component/aws/s3/client/impl/S3ClientIAMOptimizedImpl.java
+++ b/components/camel-aws-s3/src/main/java/org/apache/camel/component/aws/s3/client/impl/S3ClientIAMOptimizedImpl.java
@@ -88,7 +88,7 @@ public class S3ClientIAMOptimizedImpl implements S3Client {
}
clientBuilder = clientBuilder.withPathStyleAccessEnabled(configuration.isPathStyleAccess());
if (ObjectHelper.isNotEmpty(configuration.getEndpointConfiguration())) {
- clientBuilder.withEndpointConfiguration(configuration.getEndpointConfiguration());
+ clientBuilder.withEndpointConfiguration(configuration.getEndpointConfiguration());
}
client = clientBuilder.build();
} else {
@@ -97,7 +97,7 @@ public class S3ClientIAMOptimizedImpl implements S3Client {
}
encClientBuilder = encClientBuilder.withPathStyleAccessEnabled(configuration.isPathStyleAccess());
if (ObjectHelper.isNotEmpty(configuration.getEndpointConfiguration())) {
- encClientBuilder.withEndpointConfiguration(configuration.getEndpointConfiguration());
+ encClientBuilder.withEndpointConfiguration(configuration.getEndpointConfiguration());
}
client = encClientBuilder.build();
}
diff --git a/components/camel-aws-s3/src/main/java/org/apache/camel/component/aws/s3/client/impl/S3ClientStandardImpl.java b/components/camel-aws-s3/src/main/java/org/apache/camel/component/aws/s3/client/impl/S3ClientStandardImpl.java
index 08ba1b7..4ae3f44 100644
--- a/components/camel-aws-s3/src/main/java/org/apache/camel/component/aws/s3/client/impl/S3ClientStandardImpl.java
+++ b/components/camel-aws-s3/src/main/java/org/apache/camel/component/aws/s3/client/impl/S3ClientStandardImpl.java
@@ -89,7 +89,7 @@ public class S3ClientStandardImpl implements S3Client {
}
clientBuilder = clientBuilder.withPathStyleAccessEnabled(configuration.isPathStyleAccess());
if (ObjectHelper.isNotEmpty(configuration.getEndpointConfiguration())) {
- clientBuilder.withEndpointConfiguration(configuration.getEndpointConfiguration());
+ clientBuilder.withEndpointConfiguration(configuration.getEndpointConfiguration());
}
client = clientBuilder.build();
} else {
@@ -98,7 +98,7 @@ public class S3ClientStandardImpl implements S3Client {
}
encClientBuilder = encClientBuilder.withPathStyleAccessEnabled(configuration.isPathStyleAccess());
if (ObjectHelper.isNotEmpty(configuration.getEndpointConfiguration())) {
- encClientBuilder.withEndpointConfiguration(configuration.getEndpointConfiguration());
+ encClientBuilder.withEndpointConfiguration(configuration.getEndpointConfiguration());
}
client = encClientBuilder.build();
}
@@ -118,7 +118,7 @@ public class S3ClientStandardImpl implements S3Client {
}
clientBuilder = clientBuilder.withPathStyleAccessEnabled(configuration.isPathStyleAccess());
if (ObjectHelper.isNotEmpty(configuration.getEndpointConfiguration())) {
- clientBuilder.withEndpointConfiguration(configuration.getEndpointConfiguration());
+ clientBuilder.withEndpointConfiguration(configuration.getEndpointConfiguration());
}
client = clientBuilder.build();
} else {
@@ -127,7 +127,7 @@ public class S3ClientStandardImpl implements S3Client {
}
encClientBuilder = encClientBuilder.withPathStyleAccessEnabled(configuration.isPathStyleAccess());
if (ObjectHelper.isNotEmpty(configuration.getEndpointConfiguration())) {
- encClientBuilder.withEndpointConfiguration(configuration.getEndpointConfiguration());
+ encClientBuilder.withEndpointConfiguration(configuration.getEndpointConfiguration());
}
client = encClientBuilder.build();
}
diff --git a/components/camel-aws-s3/src/test/java/org/apache/camel/component/aws/s3/S3ComponentConfigurationTest.java b/components/camel-aws-s3/src/test/java/org/apache/camel/component/aws/s3/S3ComponentConfigurationTest.java
index 43aa227..ad11884 100644
--- a/components/camel-aws-s3/src/test/java/org/apache/camel/component/aws/s3/S3ComponentConfigurationTest.java
+++ b/components/camel-aws-s3/src/test/java/org/apache/camel/component/aws/s3/S3ComponentConfigurationTest.java
@@ -240,7 +240,7 @@ public class S3ComponentConfigurationTest extends CamelTestSupport {
S3Component component = context.getComponent("aws-s3", S3Component.class);
component.createEndpoint("aws-s3://MyTopic?amazonS3Client=#amazonS3Client");
}
-
+
@Test
public void createEndpointWithEndpointConfiguration() throws Exception {
diff --git a/components/camel-aws-s3/src/test/java/org/apache/camel/component/aws/s3/integration/S3ObjectRangeOperationIntegrationTest.java b/components/camel-aws-s3/src/test/java/org/apache/camel/component/aws/s3/integration/S3ObjectRangeOperationIntegrationTest.java
index dfebc8c..039dd55 100644
--- a/components/camel-aws-s3/src/test/java/org/apache/camel/component/aws/s3/integration/S3ObjectRangeOperationIntegrationTest.java
+++ b/components/camel-aws-s3/src/test/java/org/apache/camel/component/aws/s3/integration/S3ObjectRangeOperationIntegrationTest.java
@@ -43,7 +43,7 @@ import org.slf4j.LoggerFactory;
@Ignore("Must be manually tested. Provide your own accessKey and secretKey!")
public class S3ObjectRangeOperationIntegrationTest extends CamelTestSupport {
-
+
private static final Logger LOG = LoggerFactory.getLogger(S3ObjectRangeOperationIntegrationTest.class);
@BindToRegistry("amazonS3Client")