Interface AsyncPresignedUrlExtension
- All Known Implementing Classes:
DefaultAsyncPresignedUrlExtension,MultipartAsyncPresignedUrlExtension
S3AsyncClient.presignedUrlExtension().
Checksum Validation: If the presigned URL was generated with
S3Presigner.presignGetObject(software.amazon.awssdk.services.s3.presigner.model.GetObjectPresignRequest) using
checksumMode(ChecksumMode.ENABLED), the SDK automatically sends the required header
and S3 returns checksums for full object downloads (HTTP 200). For ranged downloads (HTTP 206),
checksums are only returned for multipart-uploaded objects when the range aligns with original
upload part boundaries. The downloader cannot enable checksums if the URL was not presigned
with checksum mode.
-
Method Summary
Modifier and TypeMethodDescriptiondefault CompletableFuture<GetObjectResponse> getObject(Consumer<PresignedUrlDownloadRequest.Builder> requestConsumer, Path destinationPath) Downloads an S3 object asynchronously using a presigned URL with a consumer-based request builder and saves it to the specified file path.default <ReturnT> CompletableFuture<ReturnT> getObject(Consumer<PresignedUrlDownloadRequest.Builder> requestConsumer, AsyncResponseTransformer<GetObjectResponse, ReturnT> responseTransformer) Downloads an S3 object asynchronously using a presigned URL with a consumer-based request builder.default CompletableFuture<GetObjectResponse> getObject(PresignedUrlDownloadRequest request, Path destinationPath) Downloads an S3 object asynchronously using a presigned URL and saves it to the specified file path.default <ReturnT> CompletableFuture<ReturnT> getObject(PresignedUrlDownloadRequest request, AsyncResponseTransformer<GetObjectResponse, ReturnT> responseTransformer) Downloads an S3 object asynchronously using a presigned URL.
-
Method Details
-
getObject
default <ReturnT> CompletableFuture<ReturnT> getObject(PresignedUrlDownloadRequest request, AsyncResponseTransformer<GetObjectResponse, ReturnT> responseTransformer) Downloads an S3 object asynchronously using a presigned URL.
This operation uses a presigned URL to download an object from Amazon S3. The presigned URL must be valid and not expired.
To download a specific byte range of the object, use the range parameter in the request.
- Type Parameters:
ReturnT- The type of the transformed response- Parameters:
request- The presigned URL request containing the URL and optional parametersresponseTransformer- Transforms the response to the desired return type- Returns:
- A
CompletableFuturecontaining the transformed result - Throws:
SdkClientException- If any client side error occursS3Exception- Base class for all S3 service exceptions
-
getObject
default <ReturnT> CompletableFuture<ReturnT> getObject(Consumer<PresignedUrlDownloadRequest.Builder> requestConsumer, AsyncResponseTransformer<GetObjectResponse, ReturnT> responseTransformer) Downloads an S3 object asynchronously using a presigned URL with a consumer-based request builder.
This is a convenience method that creates a
PresignedUrlDownloadRequestusing the provided consumer.- Type Parameters:
ReturnT- The type of the transformed response- Parameters:
requestConsumer- Consumer that will configure aPresignedUrlDownloadRequest.BuilderresponseTransformer- Transforms the response to the desired return type- Returns:
- A
CompletableFuturecontaining the transformed result - Throws:
SdkClientException- If any client side error occursS3Exception- Base class for all S3 service exceptions
-
getObject
default CompletableFuture<GetObjectResponse> getObject(PresignedUrlDownloadRequest request, Path destinationPath) Downloads an S3 object asynchronously using a presigned URL and saves it to the specified file path.
This is a convenience method that uses
AsyncResponseTransformer.toFile(Path)to save the object directly to a file.- Parameters:
request- The presigned URL request containing the URL and optional parametersdestinationPath- The path where the downloaded object will be saved- Returns:
- A
CompletableFuturecontaining theGetObjectResponse - Throws:
SdkClientException- If any client side error occursS3Exception- Base class for all S3 service exceptions
-
getObject
default CompletableFuture<GetObjectResponse> getObject(Consumer<PresignedUrlDownloadRequest.Builder> requestConsumer, Path destinationPath) Downloads an S3 object asynchronously using a presigned URL with a consumer-based request builder and saves it to the specified file path.
This is a convenience method that combines consumer-based request building with file-based response handling.
- Parameters:
requestConsumer- Consumer that will configure aPresignedUrlDownloadRequest.BuilderdestinationPath- The path where the downloaded object will be saved- Returns:
- A
CompletableFuturecontaining theGetObjectResponse - Throws:
SdkClientException- If any client side error occursS3Exception- Base class for all S3 service exceptions
-