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 57c45c1a4573e046dceccc7b105f0cf91839a343
Author: Andrea Cosentino <[email protected]>
AuthorDate: Wed Aug 26 08:22:10 2020 +0200

    CAMEL-15380 - Camel-aws2-s3: moveAfterRead define prefix or suffix
---
 .../aws2/s3/AWS2S3ComponentConfigurer.java         | 10 ++++++++
 .../aws2/s3/AWS2S3EndpointConfigurer.java          | 10 ++++++++
 .../apache/camel/component/aws2/s3/aws2-s3.json    |  4 ++++
 .../src/main/docs/aws2-s3-component.adoc           |  8 +++++--
 .../component/aws2/s3/AWS2S3Configuration.java     | 26 ++++++++++++++++++++
 .../camel/component/aws2/s3/AWS2S3Consumer.java    | 11 ++++++++-
 .../s3/integration/S3ConsumerIntegrationTest.java  |  6 +++--
 .../dsl/Aws2S3ComponentBuilderFactory.java         | 28 ++++++++++++++++++++++
 .../endpoint/dsl/AWS2S3EndpointBuilderFactory.java | 26 ++++++++++++++++++++
 9 files changed, 124 insertions(+), 5 deletions(-)

diff --git 
a/components/camel-aws2-s3/src/generated/java/org/apache/camel/component/aws2/s3/AWS2S3ComponentConfigurer.java
 
b/components/camel-aws2-s3/src/generated/java/org/apache/camel/component/aws2/s3/AWS2S3ComponentConfigurer.java
index 8740b99..fe089f3 100644
--- 
a/components/camel-aws2-s3/src/generated/java/org/apache/camel/component/aws2/s3/AWS2S3ComponentConfigurer.java
+++ 
b/components/camel-aws2-s3/src/generated/java/org/apache/camel/component/aws2/s3/AWS2S3ComponentConfigurer.java
@@ -56,6 +56,10 @@ public class AWS2S3ComponentConfigurer extends 
PropertyConfigurerSupport impleme
         case "delimiter": 
getOrCreateConfiguration(target).setDelimiter(property(camelContext, 
java.lang.String.class, value)); return true;
         case "destinationbucket":
         case "destinationBucket": 
getOrCreateConfiguration(target).setDestinationBucket(property(camelContext, 
java.lang.String.class, value)); return true;
+        case "destinationbucketprefix":
+        case "destinationBucketPrefix": 
getOrCreateConfiguration(target).setDestinationBucketPrefix(property(camelContext,
 java.lang.String.class, value)); return true;
+        case "destinationbucketsuffix":
+        case "destinationBucketSuffix": 
getOrCreateConfiguration(target).setDestinationBucketSuffix(property(camelContext,
 java.lang.String.class, value)); return true;
         case "filename":
         case "fileName": 
getOrCreateConfiguration(target).setFileName(property(camelContext, 
java.lang.String.class, value)); return true;
         case "includebody":
@@ -123,6 +127,8 @@ public class AWS2S3ComponentConfigurer extends 
PropertyConfigurerSupport impleme
         answer.put("deleteAfterWrite", boolean.class);
         answer.put("delimiter", java.lang.String.class);
         answer.put("destinationBucket", java.lang.String.class);
+        answer.put("destinationBucketPrefix", java.lang.String.class);
+        answer.put("destinationBucketSuffix", java.lang.String.class);
         answer.put("fileName", java.lang.String.class);
         answer.put("includeBody", boolean.class);
         answer.put("includeFolders", boolean.class);
@@ -184,6 +190,10 @@ public class AWS2S3ComponentConfigurer extends 
PropertyConfigurerSupport impleme
         case "delimiter": return 
getOrCreateConfiguration(target).getDelimiter();
         case "destinationbucket":
         case "destinationBucket": return 
getOrCreateConfiguration(target).getDestinationBucket();
+        case "destinationbucketprefix":
+        case "destinationBucketPrefix": return 
getOrCreateConfiguration(target).getDestinationBucketPrefix();
+        case "destinationbucketsuffix":
+        case "destinationBucketSuffix": return 
getOrCreateConfiguration(target).getDestinationBucketSuffix();
         case "filename":
         case "fileName": return getOrCreateConfiguration(target).getFileName();
         case "includebody":
diff --git 
a/components/camel-aws2-s3/src/generated/java/org/apache/camel/component/aws2/s3/AWS2S3EndpointConfigurer.java
 
b/components/camel-aws2-s3/src/generated/java/org/apache/camel/component/aws2/s3/AWS2S3EndpointConfigurer.java
index a4bbc7a..530ec2a 100644
--- 
a/components/camel-aws2-s3/src/generated/java/org/apache/camel/component/aws2/s3/AWS2S3EndpointConfigurer.java
+++ 
b/components/camel-aws2-s3/src/generated/java/org/apache/camel/component/aws2/s3/AWS2S3EndpointConfigurer.java
@@ -55,6 +55,10 @@ public class AWS2S3EndpointConfigurer extends 
PropertyConfigurerSupport implemen
         case "delimiter": 
target.getConfiguration().setDelimiter(property(camelContext, 
java.lang.String.class, value)); return true;
         case "destinationbucket":
         case "destinationBucket": 
target.getConfiguration().setDestinationBucket(property(camelContext, 
java.lang.String.class, value)); return true;
+        case "destinationbucketprefix":
+        case "destinationBucketPrefix": 
target.getConfiguration().setDestinationBucketPrefix(property(camelContext, 
java.lang.String.class, value)); return true;
+        case "destinationbucketsuffix":
+        case "destinationBucketSuffix": 
target.getConfiguration().setDestinationBucketSuffix(property(camelContext, 
java.lang.String.class, value)); return true;
         case "exceptionhandler":
         case "exceptionHandler": 
target.setExceptionHandler(property(camelContext, 
org.apache.camel.spi.ExceptionHandler.class, value)); return true;
         case "exchangepattern":
@@ -156,6 +160,8 @@ public class AWS2S3EndpointConfigurer extends 
PropertyConfigurerSupport implemen
         answer.put("deleteAfterWrite", boolean.class);
         answer.put("delimiter", java.lang.String.class);
         answer.put("destinationBucket", java.lang.String.class);
+        answer.put("destinationBucketPrefix", java.lang.String.class);
+        answer.put("destinationBucketSuffix", java.lang.String.class);
         answer.put("exceptionHandler", 
org.apache.camel.spi.ExceptionHandler.class);
         answer.put("exchangePattern", org.apache.camel.ExchangePattern.class);
         answer.put("fileName", java.lang.String.class);
@@ -240,6 +246,10 @@ public class AWS2S3EndpointConfigurer extends 
PropertyConfigurerSupport implemen
         case "delimiter": return target.getConfiguration().getDelimiter();
         case "destinationbucket":
         case "destinationBucket": return 
target.getConfiguration().getDestinationBucket();
+        case "destinationbucketprefix":
+        case "destinationBucketPrefix": return 
target.getConfiguration().getDestinationBucketPrefix();
+        case "destinationbucketsuffix":
+        case "destinationBucketSuffix": return 
target.getConfiguration().getDestinationBucketSuffix();
         case "exceptionhandler":
         case "exceptionHandler": return target.getExceptionHandler();
         case "exchangepattern":
diff --git 
a/components/camel-aws2-s3/src/generated/resources/org/apache/camel/component/aws2/s3/aws2-s3.json
 
b/components/camel-aws2-s3/src/generated/resources/org/apache/camel/component/aws2/s3/aws2-s3.json
index 93957ad..33a2656 100644
--- 
a/components/camel-aws2-s3/src/generated/resources/org/apache/camel/component/aws2/s3/aws2-s3.json
+++ 
b/components/camel-aws2-s3/src/generated/resources/org/apache/camel/component/aws2/s3/aws2-s3.json
@@ -42,6 +42,8 @@
     "deleteAfterRead": { "kind": "property", "displayName": "Delete After 
Read", "group": "consumer", "label": "consumer", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "secret": false, 
"defaultValue": "true", "configurationClass": 
"org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": 
"configuration", "description": "Delete objects from S3 after they have been 
retrieved. The delete is only performed if the Exchange is committe [...]
     "delimiter": { "kind": "property", "displayName": "Delimiter", "group": 
"consumer", "label": "consumer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "secret": false, 
"configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", 
"configurationField": "configuration", "description": "The delimiter which is 
used in the com.amazonaws.services.s3.model.ListObjectsRequest to only consume 
objects we are interested in." },
     "destinationBucket": { "kind": "property", "displayName": "Destination 
Bucket", "group": "consumer", "label": "consumer", "required": false, "type": 
"string", "javaType": "java.lang.String", "deprecated": false, "secret": false, 
"configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", 
"configurationField": "configuration", "description": "Define the destination 
bucket where an object must be moved when moveAfterRead is set to true." },
+    "destinationBucketPrefix": { "kind": "property", "displayName": 
"Destination Bucket Prefix", "group": "consumer", "label": "consumer", 
"required": false, "type": "string", "javaType": "java.lang.String", 
"deprecated": false, "secret": false, "configurationClass": 
"org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": 
"configuration", "description": "Define the destination bucket prefix to use 
when an object must be moved and moveAfterRead is set to true." },
+    "destinationBucketSuffix": { "kind": "property", "displayName": 
"Destination Bucket Suffix", "group": "consumer", "label": "consumer", 
"required": false, "type": "string", "javaType": "java.lang.String", 
"deprecated": false, "secret": false, "configurationClass": 
"org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": 
"configuration", "description": "Define the destination bucket suffix to use 
when an object must be moved and moveAfterRead is set to true." },
     "fileName": { "kind": "property", "displayName": "File Name", "group": 
"consumer", "label": "consumer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "secret": false, 
"configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", 
"configurationField": "configuration", "description": "To get the object from 
the bucket with the given file name" },
     "includeBody": { "kind": "property", "displayName": "Include Body", 
"group": "consumer", "label": "consumer", "required": false, "type": "boolean", 
"javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": 
"true", "configurationClass": 
"org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": 
"configuration", "description": "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  
[...]
     "includeFolders": { "kind": "property", "displayName": "Include Folders", 
"group": "consumer", "label": "consumer", "required": false, "type": "boolean", 
"javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": 
"true", "configurationClass": 
"org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": 
"configuration", "description": "If it is true, the folders\/directories will 
be consumed. If it is false, they will be ignored, and Exchanges will [...]
@@ -84,6 +86,8 @@
     "deleteAfterRead": { "kind": "parameter", "displayName": "Delete After 
Read", "group": "consumer", "label": "consumer", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "secret": false, 
"defaultValue": "true", "configurationClass": 
"org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": 
"configuration", "description": "Delete objects from S3 after they have been 
retrieved. The delete is only performed if the Exchange is committ [...]
     "delimiter": { "kind": "parameter", "displayName": "Delimiter", "group": 
"consumer", "label": "consumer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "secret": false, 
"configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", 
"configurationField": "configuration", "description": "The delimiter which is 
used in the com.amazonaws.services.s3.model.ListObjectsRequest to only consume 
objects we are interested in." },
     "destinationBucket": { "kind": "parameter", "displayName": "Destination 
Bucket", "group": "consumer", "label": "consumer", "required": false, "type": 
"string", "javaType": "java.lang.String", "deprecated": false, "secret": false, 
"configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", 
"configurationField": "configuration", "description": "Define the destination 
bucket where an object must be moved when moveAfterRead is set to true." },
+    "destinationBucketPrefix": { "kind": "parameter", "displayName": 
"Destination Bucket Prefix", "group": "consumer", "label": "consumer", 
"required": false, "type": "string", "javaType": "java.lang.String", 
"deprecated": false, "secret": false, "configurationClass": 
"org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": 
"configuration", "description": "Define the destination bucket prefix to use 
when an object must be moved and moveAfterRead is set to true." },
+    "destinationBucketSuffix": { "kind": "parameter", "displayName": 
"Destination Bucket Suffix", "group": "consumer", "label": "consumer", 
"required": false, "type": "string", "javaType": "java.lang.String", 
"deprecated": false, "secret": false, "configurationClass": 
"org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": 
"configuration", "description": "Define the destination bucket suffix to use 
when an object must be moved and moveAfterRead is set to true." },
     "fileName": { "kind": "parameter", "displayName": "File Name", "group": 
"consumer", "label": "consumer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "secret": false, 
"configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", 
"configurationField": "configuration", "description": "To get the object from 
the bucket with the given file name" },
     "includeBody": { "kind": "parameter", "displayName": "Include Body", 
"group": "consumer", "label": "consumer", "required": false, "type": "boolean", 
"javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": 
"true", "configurationClass": 
"org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": 
"configuration", "description": "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 [...]
     "includeFolders": { "kind": "parameter", "displayName": "Include Folders", 
"group": "consumer", "label": "consumer", "required": false, "type": "boolean", 
"javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": 
"true", "configurationClass": 
"org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": 
"configuration", "description": "If it is true, the folders\/directories will 
be consumed. If it is false, they will be ignored, and Exchanges wil [...]
diff --git a/components/camel-aws2-s3/src/main/docs/aws2-s3-component.adoc 
b/components/camel-aws2-s3/src/main/docs/aws2-s3-component.adoc
index 33f054e..8a88f1f 100644
--- a/components/camel-aws2-s3/src/main/docs/aws2-s3-component.adoc
+++ b/components/camel-aws2-s3/src/main/docs/aws2-s3-component.adoc
@@ -46,7 +46,7 @@ 
from("aws2-s3://helloBucket?accessKey=yourAccessKey&secretKey=yourSecretKey&pref
 
 
 // component options: START
-The AWS 2 S3 Storage Service component supports 40 options, which are listed 
below.
+The AWS 2 S3 Storage Service component supports 42 options, which are listed 
below.
 
 
 
@@ -74,6 +74,8 @@ The AWS 2 S3 Storage Service component supports 40 options, 
which are listed bel
 | *deleteAfterRead* (consumer) | Delete objects from S3 after they have been 
retrieved. The delete is only performed if the Exchange is committed. If a 
rollback occurs, the object is not deleted. If this option is false, then the 
same objects will be retrieve over and over again on the polls. Therefore you 
need to use the Idempotent Consumer EIP in the route to filter out duplicates. 
You can filter using the AWS2S3Constants#BUCKET_NAME and AWS2S3Constants#KEY 
headers, or only the AWS2S3C [...]
 | *delimiter* (consumer) | The delimiter which is used in the 
com.amazonaws.services.s3.model.ListObjectsRequest to only consume objects we 
are interested in. |  | String
 | *destinationBucket* (consumer) | Define the destination bucket where an 
object must be moved when moveAfterRead is set to true. |  | String
+| *destinationBucketPrefix* (consumer) | Define the destination bucket prefix 
to use when an object must be moved and moveAfterRead is set to true. |  | 
String
+| *destinationBucketSuffix* (consumer) | Define the destination bucket suffix 
to use when an object must be moved and moveAfterRead is set to true. |  | 
String
 | *fileName* (consumer) | To get the object from the bucket with the given 
file name |  | String
 | *includeBody* (consumer) | 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. | true | boolean
 | *includeFolders* (consumer) | If it is true, the folders/directories will be 
consumed. If it is false, they will be ignored, and Exchanges will not be 
created for those | true | boolean
@@ -125,7 +127,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (60 parameters):
+=== Query Parameters (62 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -151,6 +153,8 @@ with the following path and query parameters:
 | *deleteAfterRead* (consumer) | Delete objects from S3 after they have been 
retrieved. The delete is only performed if the Exchange is committed. If a 
rollback occurs, the object is not deleted. If this option is false, then the 
same objects will be retrieve over and over again on the polls. Therefore you 
need to use the Idempotent Consumer EIP in the route to filter out duplicates. 
You can filter using the AWS2S3Constants#BUCKET_NAME and AWS2S3Constants#KEY 
headers, or only the AWS2S3C [...]
 | *delimiter* (consumer) | The delimiter which is used in the 
com.amazonaws.services.s3.model.ListObjectsRequest to only consume objects we 
are interested in. |  | String
 | *destinationBucket* (consumer) | Define the destination bucket where an 
object must be moved when moveAfterRead is set to true. |  | String
+| *destinationBucketPrefix* (consumer) | Define the destination bucket prefix 
to use when an object must be moved and moveAfterRead is set to true. |  | 
String
+| *destinationBucketSuffix* (consumer) | Define the destination bucket suffix 
to use when an object must be moved and moveAfterRead is set to true. |  | 
String
 | *fileName* (consumer) | To get the object from the bucket with the given 
file name |  | String
 | *includeBody* (consumer) | 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. | true | boolean
 | *includeFolders* (consumer) | If it is true, the folders/directories will be 
consumed. If it is false, they will be ignored, and Exchanges will not be 
created for those | true | boolean
diff --git 
a/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Configuration.java
 
b/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Configuration.java
index 187c6cd..90870c3 100644
--- 
a/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Configuration.java
+++ 
b/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Configuration.java
@@ -48,6 +48,10 @@ public class AWS2S3Configuration implements Cloneable {
     private boolean moveAfterRead;
     @UriParam(label = "consumer")
     private String destinationBucket;
+    @UriParam(label = "consumer")
+    private String destinationBucketPrefix;
+    @UriParam(label = "consumer")
+    private String destinationBucketSuffix;
     @UriParam(label = "producer")
     private boolean deleteAfterWrite;
     @UriParam(label = "producer")
@@ -282,6 +286,28 @@ public class AWS2S3Configuration implements Cloneable {
         this.destinationBucket = destinationBucket;
     }
 
+    public String getDestinationBucketPrefix() {
+        return destinationBucketPrefix;
+    }
+
+    /**
+     * Define the destination bucket prefix to use when an object must be 
moved and moveAfterRead is set to true.
+     */
+    public void setDestinationBucketPrefix(String destinationBucketPrefix) {
+        this.destinationBucketPrefix = destinationBucketPrefix;
+    }
+
+    public String getDestinationBucketSuffix() {
+        return destinationBucketSuffix;
+    }
+
+    /**
+     * Define the destination bucket suffix to use when an object must be 
moved and moveAfterRead is set to true.
+     */
+    public void setDestinationBucketSuffix(String destinationBucketSuffix) {
+        this.destinationBucketSuffix = destinationBucketSuffix;
+    }
+
     public boolean isDeleteAfterWrite() {
         return deleteAfterWrite;
     }
diff --git 
a/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Consumer.java
 
b/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Consumer.java
index 621de73..0397209 100644
--- 
a/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Consumer.java
+++ 
b/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Consumer.java
@@ -275,7 +275,16 @@ public class AWS2S3Consumer extends 
ScheduledBatchPollingConsumer {
                 LOG.trace("Moving object from bucket {} with key {} to bucket 
{}...", bucketName, key,
                         getConfiguration().getDestinationBucket());
 
-                
getAmazonS3Client().copyObject(CopyObjectRequest.builder().destinationKey(key)
+                StringBuilder builder = new StringBuilder();
+
+                if 
(ObjectHelper.isNotEmpty(getConfiguration().getDestinationBucketPrefix())) {
+                    
builder.append(getConfiguration().getDestinationBucketPrefix());
+                }
+                builder.append(key);
+                if 
(ObjectHelper.isNotEmpty(getConfiguration().getDestinationBucketPrefix())) {
+                    
builder.append(getConfiguration().getDestinationBucketSuffix());
+                }
+                
getAmazonS3Client().copyObject(CopyObjectRequest.builder().destinationKey(builder.toString())
                         
.destinationBucket(getConfiguration().getDestinationBucket())
                         .copySource(bucketName + "/" + key).build());
 
diff --git 
a/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3ConsumerIntegrationTest.java
 
b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3ConsumerIntegrationTest.java
index 0703641..284767e 100644
--- 
a/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3ConsumerIntegrationTest.java
+++ 
b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3ConsumerIntegrationTest.java
@@ -37,7 +37,9 @@ public class S3ConsumerIntegrationTest extends 
CamelTestSupport {
 
     @BindToRegistry("amazonS3Client")
     S3Client client
-            = 
S3Client.builder().credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("xxx",
 "yyy")))
+            = S3Client.builder()
+                    .credentialsProvider(StaticCredentialsProvider.create(
+                            AwsBasicCredentials.create("xxxx", "yyyy")))
                     .region(Region.EU_WEST_1).build();
 
     @EndpointInject
@@ -90,7 +92,7 @@ public class S3ConsumerIntegrationTest extends 
CamelTestSupport {
 
                 
from("direct:putObject").startupOrder(1).to(awsEndpoint).to("mock:result");
 
-                
from("aws2-s3://mycamel?moveAfterRead=true&destinationBucket=camel-kafka-connector&autoCreateBucket=false")
+                
from("aws2-s3://mycamel?moveAfterRead=true&destinationBucket=camel-kafka-connector&autoCreateBucket=false&destinationBucketPrefix=RAW(movedPrefix)&destinationBucketSuffix=RAW(movedSuffix)")
                         .startupOrder(2).log("${body}");
 
             }
diff --git 
a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2S3ComponentBuilderFactory.java
 
b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2S3ComponentBuilderFactory.java
index b3f9596..64c4d6a 100644
--- 
a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2S3ComponentBuilderFactory.java
+++ 
b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2S3ComponentBuilderFactory.java
@@ -335,6 +335,32 @@ public interface Aws2S3ComponentBuilderFactory {
             return this;
         }
         /**
+         * Define the destination bucket prefix to use when an object must be
+         * moved and moveAfterRead is set to true.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: consumer
+         */
+        default Aws2S3ComponentBuilder destinationBucketPrefix(
+                java.lang.String destinationBucketPrefix) {
+            doSetProperty("destinationBucketPrefix", destinationBucketPrefix);
+            return this;
+        }
+        /**
+         * Define the destination bucket suffix to use when an object must be
+         * moved and moveAfterRead is set to true.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: consumer
+         */
+        default Aws2S3ComponentBuilder destinationBucketSuffix(
+                java.lang.String destinationBucketSuffix) {
+            doSetProperty("destinationBucketSuffix", destinationBucketSuffix);
+            return this;
+        }
+        /**
          * To get the object from the bucket with the given file name.
          * 
          * The option is a: <code>java.lang.String</code> type.
@@ -637,6 +663,8 @@ public interface Aws2S3ComponentBuilderFactory {
             case "deleteAfterRead": getOrCreateConfiguration((AWS2S3Component) 
component).setDeleteAfterRead((boolean) value); return true;
             case "delimiter": getOrCreateConfiguration((AWS2S3Component) 
component).setDelimiter((java.lang.String) value); return true;
             case "destinationBucket": 
getOrCreateConfiguration((AWS2S3Component) 
component).setDestinationBucket((java.lang.String) value); return true;
+            case "destinationBucketPrefix": 
getOrCreateConfiguration((AWS2S3Component) 
component).setDestinationBucketPrefix((java.lang.String) value); return true;
+            case "destinationBucketSuffix": 
getOrCreateConfiguration((AWS2S3Component) 
component).setDestinationBucketSuffix((java.lang.String) value); return true;
             case "fileName": getOrCreateConfiguration((AWS2S3Component) 
component).setFileName((java.lang.String) value); return true;
             case "includeBody": getOrCreateConfiguration((AWS2S3Component) 
component).setIncludeBody((boolean) value); return true;
             case "includeFolders": getOrCreateConfiguration((AWS2S3Component) 
component).setIncludeFolders((boolean) value); return true;
diff --git 
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AWS2S3EndpointBuilderFactory.java
 
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AWS2S3EndpointBuilderFactory.java
index 11bb8ad..a4e769f 100644
--- 
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AWS2S3EndpointBuilderFactory.java
+++ 
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AWS2S3EndpointBuilderFactory.java
@@ -447,6 +447,32 @@ public interface AWS2S3EndpointBuilderFactory {
             return this;
         }
         /**
+         * Define the destination bucket prefix to use when an object must be
+         * moved and moveAfterRead is set to true.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: consumer
+         */
+        default AWS2S3EndpointConsumerBuilder destinationBucketPrefix(
+                String destinationBucketPrefix) {
+            doSetProperty("destinationBucketPrefix", destinationBucketPrefix);
+            return this;
+        }
+        /**
+         * Define the destination bucket suffix to use when an object must be
+         * moved and moveAfterRead is set to true.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: consumer
+         */
+        default AWS2S3EndpointConsumerBuilder destinationBucketSuffix(
+                String destinationBucketSuffix) {
+            doSetProperty("destinationBucketSuffix", destinationBucketSuffix);
+            return this;
+        }
+        /**
          * To get the object from the bucket with the given file name.
          * 
          * The option is a: <code>java.lang.String</code> type.

Reply via email to