I am trying to copy data from one s3 folder to another within same bucket. I am using copyObject function from AmazonS3 class. I don't see any errors or exceptions and I do get result also. But the file is not copied. I would at least except some error if there is any failure. What I am doing wrong? How do I know the actual error?
AmazonS3 s3client = new AmazonS3Client(new ProfileCredentialsProvider()); CopyObjectRequest copyObjRequest = new CopyObjectRequest( sourceURI.getBucket(), sourceURI.getKey(), destinationURI.getBucket(), destinationURI.getKey());
CopyObjectResult copyResult = s3client.copyObject(copyObjRequest);
I have proper values in source and destination URI. Is it because of credentials? If in case it is not working because of missing credentials I expect an error from this code.