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

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

Introduction

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

Prototype

@Override
    public void deleteVersion(String bucketName, String key, String versionId)
            throws SdkClientException, AmazonServiceException 

Source Link

Usage

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

License:Open Source License

@Override
public DeleteVersionResponseType deleteVersion(DeleteVersionType request) throws S3Exception {
    User requestUser = getRequestUser(request);
    OsgInternalS3Client internalS3Client = null;
    try {//  www . ja v  a2  s.co  m
        internalS3Client = getS3Client(requestUser);
        AmazonS3Client s3Client = internalS3Client.getS3Client();
        s3Client.deleteVersion(request.getBucket(), request.getKey(), request.getVersionId());
        DeleteVersionResponseType reply = request.getReply();
        reply.setStatus(HttpResponseStatus.NO_CONTENT);
        reply.setStatusMessage("NO CONTENT");
        return reply;
    } catch (AmazonServiceException e) {
        LOG.debug("Error from backend", e);
        throw S3ExceptionMapper.fromAWSJavaSDK(e);
    }
}