Facing problem with duplicate file creation while copying file from s3 bucket subfolder to another sub folder using java.
I am trying to copy file from s3 bucket sub folder to another sub folder using java.
My s3 bucket name is test
and inside test
bucket I have sub folders test123/teast1234
which contains input.txt
file.
path looks like :test/test123/test1234/input.txt
I want to move input.txt file to
test/test123/test1234/ test12345/input.txt
I have tried below code :
s3client.copyObject(bucketName, objectKey, bucketName + "/test/test123/test1234/ test12345/", objectKey);
s3client.deleteObject(bucketName, objectKey);
but it is creating folder structure like below: /test/test123/test1234/test123/test1234/ test12345/
duplicate folder structure
please help me on this.