title: Rename filename on S3 using S3Client
body: <p>I try to rename filename on AWS drive. My connection with AWS is configured. I prepared a piece of code that should copy new file with changed filename, but it copies file with unchanged filename.</p>
  <pre><code>void updateFileName(String key, String newKey, String newName) {
      CopyObjectRequest copyReq = CopyObjectRequest.builder()
              .copySource(bucket + &quot;/&quot; + key)
              .destinationBucket(bucket)
              .destinationKey(newKey)
              .contentDisposition(&quot;attachment; filename=&quot; + newName)
              .build();
  
      s3Client.copyObject(copyReq);
  }
  </code></pre>