79413034

Date: 2025-02-04 21:11:25
Score: 0.5
Natty:
Report link

Discovered Version 2 of the AWS S3 Java SDK has moved the overrides directly to GetObjectRequest.

    GetObjectRequest getObjectRequestgetObjectRequest =
          GetObjectRequest.builder()
                          .bucket(bucketName)
                          .key(keyName)
                  .responseContentType(contentType)
                  .responseContentDisposition(contentDisposition)
                          .build();
        
           

     // Create a GetObjectPresignRequest to specify the signature duration
    GetObjectPresignRequest getObjectPresignRequest =
        GetObjectPresignRequest.builder()
                             .signatureDuration(Duration.ofMillis(expirationMs))
                             .getObjectRequest(getObjectRequest)
                             .build();
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: David Loy