Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   *
   *  http://aws.amazon.com/apache2.0
   *
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.s3.model;
 

Provides options for obtaining the metadata for the specified Amazon S3 object without actually fetching the object contents. This is useful if obtaining only object metadata, and avoids wasting bandwidth from retrieving the object data.

The object metadata contains information such as content type, content disposition, etc., as well as custom user metadata that can be associated with an object in Amazon S3.

For more information about enabling versioning for a bucket, see com.amazonaws.services.s3.AmazonS3Client.setBucketVersioningConfiguration(com.amazonaws.services.s3.model.SetBucketVersioningConfigurationRequest) .

 
 public class GetObjectMetadataRequest extends AmazonWebServiceRequest implements
         SSECustomerKeyProvider {
    
The name of the bucket containing the object's whose metadata is being retrieved.
 
     private String bucketName;

    
The key of the object whose metadata is being retrieved.
 
     private String key;

    
The optional version ID of the object version whose metadata is being retrieved. If not specified, the latest version will be used.
 
     private String versionId;

    
The optional customer-provided server-side encryption key to use when retrieving the metadata of a server-side encrypted object.
 
     private SSECustomerKey sseCustomerKey;


    
Constructs a new GetObjectMetadataRequest used to retrieve a specified object's metadata.

Parameters:
bucketName The name of the bucket containing the object whose metadata is being retrieved.
key The key of the object whose metadata is being retrieved.
See also:
GetObjectMetadataRequest.GetObjectMetadataRequest(java.lang.String,java.lang.String,java.lang.String)
 
     public GetObjectMetadataRequest(String bucketNameString key) {
         setBucketName(bucketName);
         setKey(key);
     }

    
Constructs a new GetObjectMetadataRequest with basic options.

Parameters:
bucketName The name of the bucket containing the object whose metadata is being retrieved.
key The key of the object whose metadata is being retrieved.
versionId The version ID of the object version whose metadata is being retrieved.
See also:
GetObjectMetadataRequest.GetObjectMetadataRequest(java.lang.String,java.lang.String)
    public GetObjectMetadataRequest(String bucketNameString keyString versionId) {
        this(bucketNamekey);
        setVersionId(versionId);
    }

    
Gets the name of the bucket containing the object whose metadata is being retrieved.

Returns:
The name of the bucket containing the object whose metadata is being retrieved.
See also:
setBucketName(java.lang.String)
withBucketName(java.lang.String)
    public String getBucketName() {
        return ;
    }

    
Sets the name of the bucket containing the object whose metadata is being retrieved.

Parameters:
bucketName The name of the bucket containing the object's whose metadata is being retrieved.
See also:
getBucketName()
withBucketName(java.lang.String)
    public void setBucketName(String bucketName) {
        this. = bucketName;
    }

    
Sets the name of the bucket containing the object whose metadata is being retrieved. Returns this GetObjectMetadataRequest, enabling additional method calls to be chained together.

Parameters:
bucketName The name of the bucket containing the object's whose metadata is being retrieved.
Returns:
This GetObjectMetadataRequest, enabling additional method calls to be chained together.
See also:
getBucketName()
setBucketName(java.lang.String)
    public GetObjectMetadataRequest withBucketName(String bucketName) {
        setBucketName(bucketName);
        return this;
    }

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

Returns:
The key of the object whose metadata is being retrieved.
See also:
setKey(java.lang.String)
withKey(java.lang.String)
    public String getKey() {
        return ;
    }

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

Parameters:
key The key of the object whose metadata is being retrieved.
See also:
getKey()
withKey(java.lang.String)
    public void setKey(String key) {
        this. = key;
    }

    
Sets the key of the object whose metadata is being retrieved. Returns this GetObjectMetadataRequest, enabling additional method calls to be chained together.

Parameters:
key The key of the object whose metadata is being retrieved.
Returns:
This GetObjectMetadataRequest, enabling additional method calls to be chained together.
See also:
getKey()
setKey(java.lang.String)
    public GetObjectMetadataRequest withKey(String key) {
        setKey(key);
        return this;
    }

    
Gets the optional version ID of the object version whose metadata is being retrieved. If not specified, the latest version will be used.

Returns:
The optional version ID of the object version whose metadata is being retrieved. If not specified, the latest version will be used.
See also:
setVersionId(java.lang.String)
withVersionId(java.lang.String)
    public String getVersionId() {
        return ;
    }

    
Sets the optional version ID of the object version whose metadata is being retrieved. If not specified, the latest version will be used.

Parameters:
versionId The optional version ID of the object version whose metadata is being retrieved. If not specified, the latest version will be used.
See also:
getVersionId()
withVersionId(java.lang.String)
    public void setVersionId(String versionId) {
        this. = versionId;
    }

    
Sets the optional version ID of the object version whose metadata is being retrieved. Returns this GetObjectMetadataRequest, enabling additional method calls to be chained together. If not specified, the latest version will be used.

Parameters:
versionId The optional version ID of the object version whose metadata is being retrieved.
Returns:
This GetObjectMetadataRequest, enabling additional method calls to be chained together.
See also:
getVersionId()
setVersionId(java.lang.String)
    public GetObjectMetadataRequest withVersionId(String versionId) {
        setVersionId(versionId);
        return this;
    }
    @Override
    public SSECustomerKey getSSECustomerKey() {
        return ;
    }

    
Sets the optional customer-provided server-side encryption key to use when retrieving the metadata of a server-side encrypted object.

Parameters:
sseKey The optional customer-provided server-side encryption key to use when retrieving the metadata of a server-side encrypted object.
    public void setSSECustomerKey(SSECustomerKey sseKey) {
        this. = sseKey;
    }

    
Sets the optional customer-provided server-side encryption key to use when retrieving the metadata of a server-side encrypted object, and retuns the updated request object so that additional method calls can be chained together.

Parameters:
sseKey The optional customer-provided server-side encryption key to use when retrieving the metadata of a server-side encrypted object.
Returns:
This updated request object so that additional method calls can be chained together.
        setSSECustomerKey(sseKey);
        return this;
    }
New to GrepCode? Check out our FAQ X