public static class S3ClientOptions.Builder extends Object
Modifier and Type | Method and Description |
---|---|
S3ClientOptions |
build() |
S3ClientOptions.Builder |
disableChunkedEncoding()
Configures the client to disable chunked encoding for all requests.
|
S3ClientOptions.Builder |
enableDualstack()
Configures the client to use the dualstack endpoint for a region
|
S3ClientOptions.Builder |
enableForceGlobalBucketAccess()
Force-enable global bucket access on the S3 client.
|
S3ClientOptions.Builder |
enableRegionalUsEast1Endpoint()
Enable resolving region us-east-1 as a regional endpoint instead of defaulting to the global endpoint.
|
S3ClientOptions.Builder |
enableUseArnRegion()
If global bucket access is not enabled, this setting will enable the client to make calls to a region
specified in an ARN that represents an S3 resource even if that region is different to the region the client
was initialized with.
|
S3ClientOptions.Builder |
setAccelerateModeEnabled(boolean accelerateModeEnabled)
Configures the client to use S3 accelerate endpoint for all requests.
|
S3ClientOptions.Builder |
setPathStyleAccess(boolean pathStyleAccess)
Configures the client to use path-style access for all requests.
|
S3ClientOptions.Builder |
setPayloadSigningEnabled(boolean payloadSigningEnabled)
Configures the client to sign payloads in all situations.
|
public S3ClientOptions build()
public S3ClientOptions.Builder setPathStyleAccess(boolean pathStyleAccess)
Configures the client to use path-style access for all requests.
Amazon S3 supports virtual-hosted-style and path-style access in all Regions. The path-style syntax, however, requires that you use the region-specific endpoint when attempting to access a bucket.
The default behaviour is to detect which access style to use based on the configured endpoint (an IP will result in path-style access) and the bucket being accessed (some buckets are not valid DNS names). Setting this flag will result in path-style access being used for all requests.
pathStyleAccess
- True to always use path-style access.public S3ClientOptions.Builder setAccelerateModeEnabled(boolean accelerateModeEnabled)
Configures the client to use S3 accelerate endpoint for all requests.
A bucket by default cannot be accessed in accelerate mode. If you wish to do so, you need to enable the accelerate configuration for the bucket in advance.
public S3ClientOptions.Builder setPayloadSigningEnabled(boolean payloadSigningEnabled)
Configures the client to sign payloads in all situations.
Payload signing is optional when chunked encoding is not used and requests are made against an HTTPS endpoint. Under these conditions the client will by default opt to not sign payloads to optimize performance. If this flag is set to true the client will instead always sign payloads.
Note: Payload signing can be expensive, particularly if transferring large payloads in a single chunk. Enabling this option will result in a performance penalty.
payloadSigningEnabled
- True to explicitly enable payload signing in all situationspublic S3ClientOptions.Builder disableChunkedEncoding()
Configures the client to disable chunked encoding for all requests.
The default behavior is to enable chunked encoding automatically for PutObjectRequest and UploadPartRequest. Setting this flag will result in disabling chunked encoding for all requests.
Note: Enabling this option has performance implications since the checksum for the payload will have to be pre-calculated before sending the data. If your payload is large this will affect the overall time required to upload an object. Using this option is recommended only if your endpoint does not implement chunked uploading.
public S3ClientOptions.Builder enableDualstack()
Configures the client to use the dualstack endpoint for a region
S3 supports dualstack endpoints which return both IPv6 and IPv4 values. Use of these endpoints is optional.
public S3ClientOptions.Builder enableForceGlobalBucketAccess()
Force-enable global bucket access on the S3 client. Any bucket-related operations invoked against a client with this option enabled will potentially be executed against other regions than the one configured in the client in order to succeed.
AmazonS3Builder.setForceGlobalBucketAccessEnabled(Boolean)
public S3ClientOptions.Builder enableUseArnRegion()
If global bucket access is not enabled, this setting will enable the client to make calls to a region specified in an ARN that represents an S3 resource even if that region is different to the region the client was initialized with. This setting is disabled by default.
public S3ClientOptions.Builder enableRegionalUsEast1Endpoint()
Enable resolving region us-east-1 as a regional endpoint instead of defaulting to the global endpoint.
AmazonS3Builder.setRegionalUsEast1EndpointEnabled(Boolean)
Copyright © 2022. All rights reserved.