title: How to rename a file in Amazon S3 Bucket?
body: <p>I am trying to rename a file in S3 Bucket.  Here is a code snippet</p>
  
  <pre><code>    S3Object s3Obj  = getS3Client().getObject(new GetObjectRequest(getBucketName(), fileName));  
  //Error in Above Line itself            
      getS3Client().putObject(getBucketName(), newFileName, s3Obj.getObjectContent(), s3Obj.getObjectMetadata());
  
  private AmazonS3 getS3Client(){
          AWSCredentials myCredentials = new BasicAWSCredentials(AccessKey,SecretKey);
          AmazonS3 s3client = new AmazonS3Client(myCredentials);
          return s3client;
  }
  </code></pre>
  
  <p>So, I am getting this error,</p>
  
  <p>DEBUG [main] request.handleErrorResponse(748) | Received error response: com.amazonaws.services.s3.model.AmazonS3Exception: Status Code: 403, AWS Service: null, AWS Request ID: AD2F31F1133A650E, AWS Error Code: AccessDenied.</p>
  
  <p>I am unable to get the s3object itself.  Any suggestions or ideas how I will get S3 Object and rename it.
  Thanks in Anticipation for you help.</p>