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

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

Introduction

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

Prototype

public String getKey() 

Source Link

Document

Gets the key of the object whose metadata is being retrieved.

Usage

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

License:Apache License

@Override
public ObjectMetadata getObjectMetadata(GetObjectMetadataRequest getObjectMetadataRequest)
        throws AmazonClientException, AmazonServiceException {
    String blobName = getObjectMetadataRequest.getKey();

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

    return new ObjectMetadata(); // nothing is done with it
}

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

License:Apache License

@Override
public ObjectMetadata getObjectMetadata(GetObjectMetadataRequest getObjectMetadataRequest)
        throws AmazonClientException, AmazonServiceException {
    simulateS3SocketConnection();//  w  ww.j a  va2  s . c o  m
    String blobName = getObjectMetadataRequest.getKey();

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

    return new ObjectMetadata(); // nothing is done with it
}