I'm trying to GET the files on Amazon S3 repository, as the question. I received the message from Amazon "InvalidAccessKeyId"
The AWS Access Key Id you provided does not exist in our records. (Service: Amazon S3; Status Code: 403; Error Code: InvalidAccessKeyId; Request ID: 62781C914754D8ED; S3 Extended Request ID: +fhv2t247XoEK99IZ6/f8lcWUz7IWlGybGfb2HRNrWpCG+EbeSupSREmcseyBcJQ3VybXizwVTg=)
Comment that the server has not given me listBucket permissions, so I'm putting the path as backet (I have also tried to put the bucket and the path in the key String bucketName= "my_bucket"; String key= "folder/folder1/example.xml"; ):
String accesKey= "my_access_key";
String secretKey= "my_secret_key";
String bucketName= "my_bucket/folder/folder1/";
String key= "example.xml";
BasicAWSCredentials creds = new BasicAWSCredentials(accesKey, secretKey);
AmazonS3 s3 = AmazonS3ClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(creds)).withRegion(Regions.EU_WEST_1).build();
s3.getObject(new GetObjectRequest(bucketName, key)