Using the AWS2 S3 component it would be nice to have a way to move a file inside a different subfolder in the same bucket after reading it.
With the current implementation, the moveAfterRead option requires to specify the destination bucket and eventually a prefix and/or suffix.
As it is not intended for moving into a different folder in the same bucket, trying to specify the original bucket as destination and the path to the subfolder as a prefix has an ugly result, as shown in the following example.
Original bucket: myBucket
File path: /path/to/foloder/run/test.txt
Result: file is moved, but file key is /path/to/folder/done/path/to/folder/test.txt
Allow moving the file under a different folder in the same bucket.
An option would be to recognize if the destination bucket is the same as the original bucket, requiring the destinationBuketPrefix to be set, moving the file (with the filename extracted from the CamelAwsS3Key) under the specified prefix.
Another option would be to introduce a new option designed specifically to move the file within the same bucket. The moveAfterRead option would then require either the destinationBucket option or the destinationSubfolderPrefix to be set.
In case the second solution is chosen, the destinationBucketSuffix option could be renamed in destinationSuffix to be used with both moving within the bucket or to another bucket or a new option (destinationSubfolderSuffix) should be introduced.