abipc
abipc

Reputation: 1035

Amazon S3 GET Object

I am uploading files to S3. When I do a GET, I get an S3Object as explained below -

    S3Object s3object = s3Client.getObject(new GetObjectRequest(
            bucketName, key));

I need to convert S3Object to java.io.File..

Is it that the following API is the only way I can do this -

S3ObjectInputStream getObjectContent()

Upvotes: 0

Views: 2783

Answers (1)

Wade Matveyenko
Wade Matveyenko

Reputation: 4430

You could use the getObject(final GetObjectRequest getObjectRequest, File destinationFile) method to do what you want. It will write your object from Amazon S3 into the destinationFile you provide.

Upvotes: 2

Related Questions