Example usage for com.amazonaws.services.s3.model DeleteObjectRequest getKey

List of usage examples for com.amazonaws.services.s3.model DeleteObjectRequest getKey

Introduction

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

Prototype

public String getKey() 

Source Link

Document

Gets the key of the object to delete.

Usage

From source file:org.elasticsearch.cloud.aws.blobstore.MockAmazonS3.java

License:Apache License

@Override
public void deleteObject(DeleteObjectRequest deleteObjectRequest)
        throws AmazonClientException, AmazonServiceException {
    String blobName = deleteObjectRequest.getKey();

    if (!blobs.containsKey(blobName)) {
        throw new AmazonS3Exception("[" + blobName + "] does not exist.");
    }/*w  w  w  . j a  v a2  s.  c o  m*/

    blobs.remove(blobName);
}

From source file:org.elasticsearch.repositories.s3.MockAmazonS3.java

License:Apache License

@Override
public void deleteObject(DeleteObjectRequest deleteObjectRequest)
        throws AmazonClientException, AmazonServiceException {
    simulateS3SocketConnection();/*w w  w . ja v  a 2 s. c o  m*/
    String blobName = deleteObjectRequest.getKey();

    if (!blobs.containsKey(blobName)) {
        throw new AmazonS3Exception("[" + blobName + "] does not exist.");
    }

    blobs.remove(blobName);
}