A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.aws.amazon.com/sdk-for-java/v2/developer-guide/examples-s3.html below:

Work with Amazon S3 - AWS SDK for Java 2.x

Work with Amazon S3

This section provides background information for working with Amazon S3 by using the AWS SDK for Java 2.x. This section compliments the Amazon S3 Java v2 examples presented in the Code examples section of this guide.

S3 clients in the AWS SDK for Java 2.x

The AWS SDK for Java 2.x provides different types of S3 clients. The following table shows the differences and can help you decide what is best for your use cases.

Different flavors of Amazon S3 clients S3 Client Short description When to use Limitation/drawback

AWS CRT-based S3 client

Interface: S3AsyncClient

Builder: S3CrtAsyncClientBuilder

See Use a performant S3 client: AWS CRT-based S3 client.

Java-based S3 async client with multipart enabled

Interface: S3AsyncClient

Builder: S3AsyncClientBuilder

See Configure the Java-based S3 async client to use parallel transfers.

Less performant than the AWS CRT-based S3 client.

Java-based S3 async client without multipart enabled

Interface: S3AsyncClient

Builder: S3AsyncClientBuilder

No performance optimization.

Java-based S3 sync client

Interface: S3Client

Builder: S3ClientBuilder

No performance optimization.

Note

From version 2.18.x and onward, the AWS SDK for Java 2.x uses virtual hosted-style addressing when including an endpoint override. This applies as long as the bucket name is a valid DNS label.

Call the forcePathStyle method with true in your client builder to force the client to use path-style addressing for buckets.

The following example shows a service client configured with an endpoint override and using path-style addressing.

S3Client client = S3Client.builder()
                          .region(Region.US_WEST_2)
                          .endpointOverride(URI.create("https://s3.us-west-2.amazonaws.com"))
                          .forcePathStyle(true)
                          .build();

Lambda

Uploading streams to S3

Did this page help you? - Yes

Thanks for letting us know we're doing a good job!

If you've got a moment, please tell us what we did right so we can do more of it.

Did this page help you? - No

Thanks for letting us know this page needs work. We're sorry we let you down.

If you've got a moment, please tell us how we can make the documentation better.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4