Class S3Source.Builder

java.lang.Object
dev.hardwood.s3.S3Source.Builder
Enclosing class:
S3Source

public static final class S3Source.Builder extends Object
Builder for S3Source.
  • Method Details

    • region

      public S3Source.Builder region(String region)
      Sets the AWS region (e.g. "eu-west-1", "auto").
    • endpoint

      public S3Source.Builder endpoint(String endpoint)
      Sets the endpoint for S3-compatible services (e.g. MinIO, R2, GCP).
    • pathStyle

      public S3Source.Builder pathStyle(boolean pathStyle)
      Forces path-style access (endpoint/bucket/key instead of bucket.endpoint/key).
    • credentials

      public S3Source.Builder credentials(S3CredentialsProvider provider)
      Sets the credential provider.
    • credentials

      public S3Source.Builder credentials(S3Credentials credentials)
      Sets static credentials (convenience shorthand).
    • connectTimeout

      public S3Source.Builder connectTimeout(Duration connectTimeout)
      Sets the connect timeout for the HTTP client (default 10 seconds).
    • requestTimeout

      public S3Source.Builder requestTimeout(Duration requestTimeout)
      Sets the per-request timeout for individual HTTP requests (default 30 seconds).
    • maxRetries

      public S3Source.Builder maxRetries(int maxRetries)
      Sets the maximum number of retries for GET requests on transient failures (HTTP 500/503 and network errors). Default is 3.
    • httpClient

      public S3Source.Builder httpClient(HttpClient httpClient)
      Sets a custom HttpClient for full control over connection pooling and transport settings. When provided, the caller is responsible for closing the client — S3Source.close() will not close it. Connect timeout is ignored when a custom client is supplied.
    • build

      public S3Source build()

      Builds the S3Source.

      Region is required when targeting AWS S3 (no custom endpoint). When a custom endpoint is set, region is not used for routing and can be omitted — an arbitrary value is used for signing.