Example usage for com.amazonaws.services.s3 AmazonS3Client getBucketVersioningConfiguration

List of usage examples for com.amazonaws.services.s3 AmazonS3Client getBucketVersioningConfiguration

Introduction

In this page you can find the example usage for com.amazonaws.services.s3 AmazonS3Client getBucketVersioningConfiguration.

Prototype

@Override
    public BucketVersioningConfiguration getBucketVersioningConfiguration(
            GetBucketVersioningConfigurationRequest getBucketVersioningConfigurationRequest)
            throws SdkClientException, AmazonServiceException 

Source Link

Usage

From source file:com.eucalyptus.objectstorage.providers.s3.S3ProviderClient.java

License:Open Source License

@Override
public GetBucketVersioningStatusResponseType getBucketVersioningStatus(GetBucketVersioningStatusType request)
        throws S3Exception {
    GetBucketVersioningStatusResponseType reply = request.getReply();
    User requestUser = getRequestUser(request);
    OsgInternalS3Client internalS3Client = null;

    try {/*from  w w w . j a v  a2s.c  o m*/
        internalS3Client = getS3Client(requestUser);
        AmazonS3Client s3Client = internalS3Client.getS3Client();
        BucketVersioningConfiguration versioning = s3Client
                .getBucketVersioningConfiguration(request.getBucket());
        reply.setVersioningStatus(versioning.getStatus());
    } catch (AmazonServiceException e) {
        LOG.debug("Error from backend", e);
        throw S3ExceptionMapper.fromAWSJavaSDK(e);
    }

    return reply;
}