Example usage for com.amazonaws.services.s3.model GetObjectRequest setVersionId

List of usage examples for com.amazonaws.services.s3.model GetObjectRequest setVersionId

Introduction

In this page you can find the example usage for com.amazonaws.services.s3.model GetObjectRequest setVersionId.

Prototype

public void setVersionId(String versionId) 

Source Link

Document

Sets the optional version ID specifying which version of the object to download.

Usage

From source file:org.springframework.cloud.aws.core.io.s3.SimpleStorageResource.java

License:Apache License

@Override
public InputStream getInputStream() throws IOException {
    GetObjectRequest getObjectRequest = new GetObjectRequest(this.bucketName, this.objectName);
    if (this.versionId != null) {
        getObjectRequest.setVersionId(this.versionId);
    }//from   w  ww  .  j  a v  a2  s. com
    return this.amazonS3.getObject(getObjectRequest).getObjectContent();
}