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 2019/07/02 08:21:31 UTC
[camel] branch master updated (7da288c -> e1c4a19)
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.
from 7da288c Upgrade Brave Zipkin to version 5.6.6
new 4db2571 CAMEL-13714 - Camel-AWS-S3: Add and option to specify the S3 Key also as endpoint parameter
new 0fd74a5 CAMEL-13714 - Camel-AWS-S3: Add and option to specify the S3 Key also as endpoint parameter, adding test
new c6ca9d4 CAMEL-13714 - Fixed CS
new e1c4a19 Regen
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../camel-aws-s3/src/main/docs/aws-s3-component.adoc | 6 ++++--
.../apache/camel/component/aws/s3/S3Configuration.java | 17 +++++++++++++++--
.../org/apache/camel/component/aws/s3/S3Producer.java | 3 +++
...entFileTest.java => S3ComponentKeyNameFileTest.java} | 10 ++++------
.../builder/endpoint/dsl/S3EndpointBuilderFactory.java | 10 ++++++++++
.../components/modules/ROOT/pages/aws-s3-component.adoc | 6 ++++--
.../components/modules/ROOT/pages/cm-sms-component.adoc | 6 +++---
.../aws/s3/springboot/S3ComponentConfiguration.java | 13 +++++++++++++
8 files changed, 56 insertions(+), 15 deletions(-)
copy components/camel-aws-s3/src/test/java/org/apache/camel/component/aws/s3/{S3ComponentFileTest.java => S3ComponentKeyNameFileTest.java} (95%)
[camel] 01/04: CAMEL-13714 - Camel-AWS-S3: Add and option to
specify the S3 Key also as endpoint parameter
Posted by ac...@apache.org.
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 4db25713dca73f3c321af0aeb076acd88f529256
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Jul 2 09:17:04 2019 +0200
CAMEL-13714 - Camel-AWS-S3: Add and option to specify the S3 Key also as endpoint parameter
---
.../apache/camel/component/aws/s3/S3Configuration.java | 15 ++++++++++++++-
.../org/apache/camel/component/aws/s3/S3Producer.java | 5 ++++-
2 files changed, 18 insertions(+), 2 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 b43f64e..3cd8efc 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
@@ -90,6 +90,8 @@ public class S3Configuration implements Cloneable {
private String awsKMSKeyId;
@UriParam(defaultValue = "false")
private boolean useIAMCredentials;
+ @UriParam(label = "producer")
+ private String keyName;
public long getPartSize() {
return partSize;
@@ -475,7 +477,18 @@ public class S3Configuration implements Cloneable {
this.autoCreateBucket = autoCreateBucket;
}
- public boolean hasProxyConfiguration() {
+ public String getKeyName() {
+ return keyName;
+ }
+
+ /**
+ * Setting the key name for an element in the bucket through endpoint parameter
+ */
+ public void setKeyName(String keyName) {
+ this.keyName = keyName;
+ }
+
+ public boolean hasProxyConfiguration() {
return ObjectHelper.isNotEmpty(getProxyHost()) && ObjectHelper.isNotEmpty(getProxyPort());
}
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 ce4b8c5..84621b6 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
@@ -471,8 +471,11 @@ public class S3Producer extends DefaultProducer {
private String determineKey(final Exchange exchange) {
String key = exchange.getIn().getHeader(S3Constants.KEY, String.class);
+ if (ObjectHelper.isEmpty(key)) {
+ key = getConfiguration().getKeyName();
+ }
if (key == null) {
- throw new IllegalArgumentException("AWS S3 Key header missing.");
+ throw new IllegalArgumentException("AWS S3 Key header missing.");
}
return key;
}
[camel] 02/04: CAMEL-13714 - Camel-AWS-S3: Add and option to
specify the S3 Key also as endpoint parameter, adding test
Posted by ac...@apache.org.
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 0fd74a5245caea9a0c626144b31c037c786ec2e0
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Jul 2 09:29:03 2019 +0200
CAMEL-13714 - Camel-AWS-S3: Add and option to specify the S3 Key also as endpoint parameter, adding test
---
.../src/main/docs/aws-s3-component.adoc | 3 +-
.../aws/s3/S3ComponentKeyNameFileTest.java | 150 +++++++++++++++++++++
.../endpoint/dsl/S3EndpointBuilderFactory.java | 10 ++
.../s3/springboot/S3ComponentConfiguration.java | 13 ++
4 files changed, 175 insertions(+), 1 deletion(-)
diff --git a/components/camel-aws-s3/src/main/docs/aws-s3-component.adoc b/components/camel-aws-s3/src/main/docs/aws-s3-component.adoc
index 86da7b0..d907e47 100644
--- a/components/camel-aws-s3/src/main/docs/aws-s3-component.adoc
+++ b/components/camel-aws-s3/src/main/docs/aws-s3-component.adoc
@@ -81,7 +81,7 @@ with the following path and query parameters:
|===
-==== Query Parameters (54 parameters):
+==== Query Parameters (55 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
@@ -111,6 +111,7 @@ with the following path and query parameters:
| *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. | | ExchangePattern
| *pollStrategy* (consumer) | A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel. | | PollingConsumerPoll Strategy
| *deleteAfterWrite* (producer) | Delete file object after the S3 file has been uploaded | false | boolean
+| *keyName* (producer) | Setting the key name for an element in the bucket through endpoint parameter | | String
| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
| *multiPartUpload* (producer) | If it is true, camel will upload the file with multi part format, the part size is decided by the option of partSize | false | boolean
| *operation* (producer) | The operation to do in case the user don't want to do only an upload | | S3Operations
diff --git a/components/camel-aws-s3/src/test/java/org/apache/camel/component/aws/s3/S3ComponentKeyNameFileTest.java b/components/camel-aws-s3/src/test/java/org/apache/camel/component/aws/s3/S3ComponentKeyNameFileTest.java
new file mode 100644
index 0000000..d873514
--- /dev/null
+++ b/components/camel-aws-s3/src/test/java/org/apache/camel/component/aws/s3/S3ComponentKeyNameFileTest.java
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.s3;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import java.io.InputStream;
+import java.util.Map;
+
+import com.amazonaws.services.s3.model.PutObjectRequest;
+
+import org.apache.camel.BindToRegistry;
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePattern;
+import org.apache.camel.Message;
+import org.apache.camel.Processor;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.camel.util.FileUtil;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class S3ComponentKeyNameFileTest extends CamelTestSupport {
+
+ @BindToRegistry("amazonS3Client")
+ AmazonS3ClientMock client = new AmazonS3ClientMock();
+
+ @EndpointInject("direct:startKeep")
+ ProducerTemplate templateKeep;
+
+ @EndpointInject("direct:startDelete")
+ ProducerTemplate templateDelete;
+
+ @EndpointInject("mock:result")
+ MockEndpoint result;
+
+ File testFile;
+
+ String getCamelBucket() {
+ return "mycamelbucket";
+ }
+
+ @Before
+ public void setup() throws Exception {
+ super.setUp();
+
+ testFile = FileUtil.createTempFile("test", "file", new File("target/tmp"));
+
+ FileWriter writer = new FileWriter(testFile);
+ writer.write("This is my bucket content.");
+ writer.close();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ super.tearDown();
+
+ FileUtil.deleteFile(testFile);
+ }
+
+ @Test
+ public void sendFile() throws Exception {
+ result.expectedMessageCount(1);
+
+ Exchange exchange = templateKeep.send("direct:startKeep", ExchangePattern.InOnly, new Processor() {
+ public void process(Exchange exchange) throws Exception {
+ exchange.getIn().setBody(new FileInputStream(testFile));
+ }
+ });
+
+ assertMockEndpointsSatisfied();
+
+ assertResultExchange(result.getExchanges().get(0), true);
+
+ PutObjectRequest putObjectRequest = client.putObjectRequests.get(0);
+ assertEquals(getCamelBucket(), putObjectRequest.getBucketName());
+
+ assertResponseMessage(exchange.getIn());
+
+ assertFileExists(testFile.getAbsolutePath());
+ }
+
+ void assertResultExchange(Exchange resultExchange, boolean delete) {
+ assertIsInstanceOf(InputStream.class, resultExchange.getIn().getBody());
+
+ if (!delete) {
+ // assert on the file content only in case the "deleteAfterWrite"
+ // option is NOT enabled
+ // in which case we would still have the file and thereby could
+ // assert on it's content
+ assertEquals("This is my bucket content.", resultExchange.getIn().getBody(String.class));
+ }
+
+ assertEquals(getCamelBucket(), resultExchange.getIn().getHeader(S3Constants.BUCKET_NAME));
+ assertEquals("CamelUnitTest", resultExchange.getIn().getHeader(S3Constants.KEY));
+ assertNull(resultExchange.getIn().getHeader(S3Constants.VERSION_ID)); // not
+ // enabled
+ // on
+ // this
+ // bucket
+ assertNull(resultExchange.getIn().getHeader(S3Constants.LAST_MODIFIED));
+ assertNull(resultExchange.getIn().getHeader(S3Constants.E_TAG));
+ assertNull(resultExchange.getIn().getHeader(S3Constants.CONTENT_TYPE));
+ assertNull(resultExchange.getIn().getHeader(S3Constants.CONTENT_ENCODING));
+ assertEquals(0L, resultExchange.getIn().getHeader(S3Constants.CONTENT_LENGTH));
+ assertNull(resultExchange.getIn().getHeader(S3Constants.CONTENT_DISPOSITION));
+ assertNull(resultExchange.getIn().getHeader(S3Constants.CONTENT_MD5));
+ assertNull(resultExchange.getIn().getHeader(S3Constants.CACHE_CONTROL));
+ assertNotNull(resultExchange.getIn().getHeader(S3Constants.USER_METADATA));
+ assertEquals(0, resultExchange.getIn().getHeader(S3Constants.S3_HEADERS, Map.class).size());
+ }
+
+ void assertResponseMessage(Message message) {
+ assertEquals("3a5c8b1ad448bca04584ecb55b836264", message.getHeader(S3Constants.E_TAG));
+ assertNull(message.getHeader(S3Constants.VERSION_ID));
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ String awsEndpoint = "aws-s3://" + getCamelBucket() + "?amazonS3Client=#amazonS3Client";
+
+ from("direct:startKeep").to(awsEndpoint + "&deleteAfterWrite=false&keyName=CamelUnitTest");
+
+ from(awsEndpoint + "&maxMessagesPerPoll=5").to("mock:result");
+ }
+ };
+ }
+}
diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/S3EndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/S3EndpointBuilderFactory.java
index 8643694..2ec8de0 100644
--- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/S3EndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/S3EndpointBuilderFactory.java
@@ -1159,6 +1159,16 @@ public interface S3EndpointBuilderFactory {
return this;
}
/**
+ * Setting the key name for an element in the bucket through endpoint
+ * parameter.
+ * The option is a <code>java.lang.String</code> type.
+ * @group producer
+ */
+ default S3EndpointProducerBuilder keyName(String keyName) {
+ setProperty("keyName", keyName);
+ return this;
+ }
+ /**
* Whether the producer should be started lazy (on the first message).
* By starting lazy you can use this to allow CamelContext and routes to
* startup in situations where a producer may otherwise fail during
diff --git a/platforms/spring-boot/components-starter/camel-aws-s3-starter/src/main/java/org/apache/camel/component/aws/s3/springboot/S3ComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-aws-s3-starter/src/main/java/org/apache/camel/component/aws/s3/springboot/S3ComponentConfiguration.java
index 3517759..5e629d7 100644
--- a/platforms/spring-boot/components-starter/camel-aws-s3-starter/src/main/java/org/apache/camel/component/aws/s3/springboot/S3ComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-aws-s3-starter/src/main/java/org/apache/camel/component/aws/s3/springboot/S3ComponentConfiguration.java
@@ -279,6 +279,11 @@ public class S3ComponentConfiguration
* Setting the autocreation of the bucket
*/
private Boolean autoCreateBucket = true;
+ /**
+ * Setting the key name for an element in the bucket through endpoint
+ * parameter
+ */
+ private String keyName;
public Long getPartSize() {
return partSize;
@@ -537,5 +542,13 @@ public class S3ComponentConfiguration
public void setAutoCreateBucket(Boolean autoCreateBucket) {
this.autoCreateBucket = autoCreateBucket;
}
+
+ public String getKeyName() {
+ return keyName;
+ }
+
+ public void setKeyName(String keyName) {
+ this.keyName = keyName;
+ }
}
}
\ No newline at end of file
[camel] 04/04: Regen
Posted by ac...@apache.org.
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 e1c4a1999ab419dde9f077a5f77e9881be368d5c
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Jul 2 10:21:00 2019 +0200
Regen
---
components/camel-aws-s3/src/main/docs/aws-s3-component.adoc | 3 ++-
docs/components/modules/ROOT/pages/aws-s3-component.adoc | 6 ++++--
docs/components/modules/ROOT/pages/cm-sms-component.adoc | 6 +++---
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/components/camel-aws-s3/src/main/docs/aws-s3-component.adoc b/components/camel-aws-s3/src/main/docs/aws-s3-component.adoc
index d907e47..0f3220b 100644
--- a/components/camel-aws-s3/src/main/docs/aws-s3-component.adoc
+++ b/components/camel-aws-s3/src/main/docs/aws-s3-component.adoc
@@ -160,7 +160,7 @@ When using Spring Boot make sure to use the following Maven dependency to have s
----
-The component supports 38 options, which are listed below.
+The component supports 39 options, which are listed below.
@@ -185,6 +185,7 @@ The component supports 38 options, which are listed below.
| *camel.component.aws-s3.configuration.file-name* | To get the object from the bucket with the given file name | | String
| *camel.component.aws-s3.configuration.force-global-bucket-access-enabled* | Define if Force Global Bucket Access enabled is true or false | false | Boolean
| *camel.component.aws-s3.configuration.include-body* | If it is true, the exchange body will be set to a stream to the contents of the file. If false, the headers will be set with the S3 object metadata, but the body will be null. This option is strongly related to autocloseBody option. In case of setting includeBody to true and autocloseBody to false, it will be up to the caller to close the S3Object stream. Setting autocloseBody to true, will close the S3Object stream automatically. | [...]
+| *camel.component.aws-s3.configuration.key-name* | Setting the key name for an element in the bucket through endpoint parameter | | String
| *camel.component.aws-s3.configuration.multi-part-upload* | If it is true, camel will upload the file with multi part format, the part size is decided by the option of `partSize` | false | Boolean
| *camel.component.aws-s3.configuration.operation* | The operation to do in case the user don't want to do only an upload | | S3Operations
| *camel.component.aws-s3.configuration.part-size* | Setup the partSize which is used in multi part upload, the default size is 25M. | 26214400 | Long
diff --git a/docs/components/modules/ROOT/pages/aws-s3-component.adoc b/docs/components/modules/ROOT/pages/aws-s3-component.adoc
index 86da7b0..0f3220b 100644
--- a/docs/components/modules/ROOT/pages/aws-s3-component.adoc
+++ b/docs/components/modules/ROOT/pages/aws-s3-component.adoc
@@ -81,7 +81,7 @@ with the following path and query parameters:
|===
-==== Query Parameters (54 parameters):
+==== Query Parameters (55 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
@@ -111,6 +111,7 @@ with the following path and query parameters:
| *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. | | ExchangePattern
| *pollStrategy* (consumer) | A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel. | | PollingConsumerPoll Strategy
| *deleteAfterWrite* (producer) | Delete file object after the S3 file has been uploaded | false | boolean
+| *keyName* (producer) | Setting the key name for an element in the bucket through endpoint parameter | | String
| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
| *multiPartUpload* (producer) | If it is true, camel will upload the file with multi part format, the part size is decided by the option of partSize | false | boolean
| *operation* (producer) | The operation to do in case the user don't want to do only an upload | | S3Operations
@@ -159,7 +160,7 @@ When using Spring Boot make sure to use the following Maven dependency to have s
----
-The component supports 38 options, which are listed below.
+The component supports 39 options, which are listed below.
@@ -184,6 +185,7 @@ The component supports 38 options, which are listed below.
| *camel.component.aws-s3.configuration.file-name* | To get the object from the bucket with the given file name | | String
| *camel.component.aws-s3.configuration.force-global-bucket-access-enabled* | Define if Force Global Bucket Access enabled is true or false | false | Boolean
| *camel.component.aws-s3.configuration.include-body* | If it is true, the exchange body will be set to a stream to the contents of the file. If false, the headers will be set with the S3 object metadata, but the body will be null. This option is strongly related to autocloseBody option. In case of setting includeBody to true and autocloseBody to false, it will be up to the caller to close the S3Object stream. Setting autocloseBody to true, will close the S3Object stream automatically. | [...]
+| *camel.component.aws-s3.configuration.key-name* | Setting the key name for an element in the bucket through endpoint parameter | | String
| *camel.component.aws-s3.configuration.multi-part-upload* | If it is true, camel will upload the file with multi part format, the part size is decided by the option of `partSize` | false | Boolean
| *camel.component.aws-s3.configuration.operation* | The operation to do in case the user don't want to do only an upload | | S3Operations
| *camel.component.aws-s3.configuration.part-size* | Setup the partSize which is used in multi part upload, the default size is 25M. | 26214400 | Long
diff --git a/docs/components/modules/ROOT/pages/cm-sms-component.adoc b/docs/components/modules/ROOT/pages/cm-sms-component.adoc
index d40ba67..08af984 100644
--- a/docs/components/modules/ROOT/pages/cm-sms-component.adoc
+++ b/docs/components/modules/ROOT/pages/cm-sms-component.adoc
@@ -71,10 +71,10 @@ with the following path and query parameters:
[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
-| *defaultFrom* (producer) | This is the sender name. The maximum length is 11 characters. | | String)
-| *defaultMaxNumberOfParts* (producer) | If it is a multipart message forces the max number. Message can be truncated. Technically the gateway will first check if a message is larger than 160 characters, if so, the message will be cut into multiple 153 characters parts limited by these parameters. | 8 | Max(8L)::Int)
+| *defaultFrom* (producer) | *Required* This is the sender name. The maximum length is 11 characters. | | String
+| *defaultMaxNumberOfParts* (producer) | If it is a multipart message forces the max number. Message can be truncated. Technically the gateway will first check if a message is larger than 160 characters, if so, the message will be cut into multiple 153 characters parts limited by these parameters. | 8 | int
| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
-| *productToken* (producer) | *Required* The unique token to use | | String)
+| *productToken* (producer) | *Required* The unique token to use | | String
| *testConnectionOnStartup* (producer) | Whether to test the connection to the SMS Gateway on startup | false | boolean
| *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
[camel] 03/04: CAMEL-13714 - Fixed CS
Posted by ac...@apache.org.
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 c6ca9d4a42029bc4b311f60792f12b58473d70bb
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Jul 2 09:49:53 2019 +0200
CAMEL-13714 - Fixed CS
---
.../apache/camel/component/aws/s3/S3Configuration.java | 18 +++++++++---------
.../org/apache/camel/component/aws/s3/S3Producer.java | 4 ++--
2 files changed, 11 insertions(+), 11 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 3cd8efc..e239115 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
@@ -144,8 +144,7 @@ public class S3Configuration implements Cloneable {
}
/**
- * Reference to a `com.amazonaws.services.s3.AmazonS3` in the
- * registry.
+ * Reference to a `com.amazonaws.services.s3.AmazonS3` in the registry.
*/
public void setAmazonS3Client(AmazonS3 amazonS3Client) {
this.amazonS3Client = amazonS3Client;
@@ -478,17 +477,18 @@ public class S3Configuration implements Cloneable {
}
public String getKeyName() {
- return keyName;
- }
+ return keyName;
+ }
/**
- * Setting the key name for an element in the bucket through endpoint parameter
+ * Setting the key name for an element in the bucket through endpoint
+ * parameter
*/
- public void setKeyName(String keyName) {
- this.keyName = keyName;
- }
+ public void setKeyName(String keyName) {
+ this.keyName = keyName;
+ }
- public boolean hasProxyConfiguration() {
+ public boolean hasProxyConfiguration() {
return ObjectHelper.isNotEmpty(getProxyHost()) && ObjectHelper.isNotEmpty(getProxyPort());
}
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 84621b6..dc4f810 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
@@ -472,10 +472,10 @@ public class S3Producer extends DefaultProducer {
private String determineKey(final Exchange exchange) {
String key = exchange.getIn().getHeader(S3Constants.KEY, String.class);
if (ObjectHelper.isEmpty(key)) {
- key = getConfiguration().getKeyName();
+ key = getConfiguration().getKeyName();
}
if (key == null) {
- throw new IllegalArgumentException("AWS S3 Key header missing.");
+ throw new IllegalArgumentException("AWS S3 Key header missing.");
}
return key;
}