@NotThreadSafe public final class AmazonS3ClientBuilder extends AwsSyncClientBuilder<AmazonS3ClientBuilder,AmazonS3>
AwsClientBuilder.SyncBuilderParams
Modifier and Type | Method and Description |
---|---|
protected AmazonS3 |
build(AwsSyncClientParams clientParams)
Construct a synchronous implementation of AmazonS3 using the current builder configuration.
|
static AmazonS3 |
defaultClient() |
AmazonS3ClientBuilder |
disableChunkedEncoding()
Disables chunked encoding on clients built via the builder.
|
AmazonS3ClientBuilder |
enableAccelerateMode()
Enables accelerate mode on clients built with the builder.
|
AmazonS3ClientBuilder |
enableDualstack()
Enables dualstack mode on clients built with the builder.
|
AmazonS3ClientBuilder |
enablePathStyleAccess()
Enables path style access for clients built via this builder.
|
AmazonS3ClientBuilder |
enablePayloadSigning()
Enables payload signing for all situations on clients built via this builder.
|
Boolean |
isAccelerateModeEnabled() |
Boolean |
isChunkedEncodingDisabled() |
Boolean |
isDualstackEnabled() |
Boolean |
isPathStyleAccessEnabled() |
Boolean |
isPayloadSigningEnabled() |
void |
setAccelerateModeEnabled(Boolean accelerateModeEnabled)
Configures the client to use S3 accelerate endpoint for all requests.
|
void |
setChunkedEncodingDisabled(Boolean chunkedEncodingDisabled)
Configures the client to disable chunked encoding for all requests.
|
void |
setDualstackEnabled(Boolean dualstackEnabled)
Configures the client to use Amazon S3 dualstack mode for all requests.
|
void |
setPathStyleAccessEnabled(Boolean pathStyleAccessEnabled)
Configures the client to use path-style access for all requests.
|
void |
setPayloadSigningEnabled(Boolean payloadSigningEnabled)
Configures the client to sign payloads in all situations.
|
static AmazonS3ClientBuilder |
standard() |
AmazonS3ClientBuilder |
withAccelerateModeEnabled(Boolean accelerateModeEnabled)
Configures the client to use S3 accelerate endpoint for all requests.
|
AmazonS3ClientBuilder |
withChunkedEncodingDisabled(Boolean chunkedEncodingDisabled)
Configures the client to disable chunked encoding for all requests.
|
AmazonS3ClientBuilder |
withDualstackEnabled(Boolean dualstackEnabled)
Configures the client to use Amazon S3 dualstack mode for all requests.
|
AmazonS3ClientBuilder |
withPathStyleAccessEnabled(Boolean pathStyleAccessEnabled)
Configures the client to use path-style access for all requests.
|
AmazonS3ClientBuilder |
withPayloadSigningEnabled(Boolean payloadSigningEnabled)
Configures the client to sign payloads in all situations.
|
build
getClientConfiguration, getCredentials, getMetricsCollector, getRegion, getRequestHandlers, getSubclass, getSyncClientParams, setClientConfiguration, setCredentials, setMetricsCollector, setRegion, setRequestHandlers, withClientConfiguration, withCredentials, withMetricsCollector, withRegion, withRegion, withRequestHandlers
public static AmazonS3ClientBuilder standard()
public static AmazonS3 defaultClient()
DefaultAWSCredentialsProviderChain
and DefaultAwsRegionProviderChain
chainpublic Boolean isPathStyleAccessEnabled()
public void setPathStyleAccessEnabled(Boolean pathStyleAccessEnabled)
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.
pathStyleAccessEnabled
- True to always use path-style access.public AmazonS3ClientBuilder withPathStyleAccessEnabled(Boolean pathStyleAccessEnabled)
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.
pathStyleAccessEnabled
- True to always use path-style access.public AmazonS3ClientBuilder enablePathStyleAccess()
Enables path style access for clients built via this builder.
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.
public Boolean isChunkedEncodingDisabled()
public void setChunkedEncodingDisabled(Boolean chunkedEncodingDisabled)
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.
chunkedEncodingDisabled
- True to disable chunked encoding.public AmazonS3ClientBuilder withChunkedEncodingDisabled(Boolean chunkedEncodingDisabled)
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.
chunkedEncodingDisabled
- True to disable chunked encoding.public AmazonS3ClientBuilder disableChunkedEncoding()
Disables chunked encoding on clients built via the builder.
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 Boolean isAccelerateModeEnabled()
public void 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. To enable accelerate mode
see AmazonS3Client.setBucketAccelerateConfiguration(com.amazonaws.services.s3.model.SetBucketAccelerateConfigurationRequest)
.
accelerateModeEnabled
- True to enable accelerate mode.public AmazonS3ClientBuilder withAccelerateModeEnabled(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. To enable accelerate mode
see AmazonS3Client.setBucketAccelerateConfiguration(com.amazonaws.services.s3.model.SetBucketAccelerateConfigurationRequest)
.
accelerateModeEnabled
- True to enable accelerate mode.public AmazonS3ClientBuilder enableAccelerateMode()
Enables accelerate mode on clients built with the builder.
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. To enable accelerate mode
see AmazonS3Client.setBucketAccelerateConfiguration(com.amazonaws.services.s3.model.SetBucketAccelerateConfigurationRequest)
.
public Boolean isPayloadSigningEnabled()
public void 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 AmazonS3ClientBuilder withPayloadSigningEnabled(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 AmazonS3ClientBuilder enablePayloadSigning()
Enables payload signing for all situations on clients built via this builder.
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.
public Boolean isDualstackEnabled()
public void setDualstackEnabled(Boolean dualstackEnabled)
Configures the client to use Amazon S3 dualstack mode for all requests.
dualstackEnabled
- True to enable dualstack mode.public AmazonS3ClientBuilder withDualstackEnabled(Boolean dualstackEnabled)
Configures the client to use Amazon S3 dualstack mode for all requests.
dualstackEnabled
- True to enable dualstack mode.public AmazonS3ClientBuilder enableDualstack()
Enables dualstack mode on clients built with the builder.
protected AmazonS3 build(AwsSyncClientParams clientParams)
build
in class AwsSyncClientBuilder<AmazonS3ClientBuilder,AmazonS3>
Copyright © 2017. All rights reserved.