com.amazonaws.services.s3.model
Class GetObjectMetadataRequest

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceRequest
      extended by com.amazonaws.services.s3.model.GetObjectMetadataRequest

public class GetObjectMetadataRequest
extends AmazonWebServiceRequest

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 AmazonS3#setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest).

See Also:
GetObjectMetadataRequest(String, String), GetObjectMetadataRequest(String, String, String), GetObjectRequest

Constructor Summary
GetObjectMetadataRequest(String bucketName, String key)
          Constructs a new GetObjectMetadataRequest used to retrieve a specified object's metadata.
GetObjectMetadataRequest(String bucketName, String key, String versionId)
          Constructs a new GetObjectMetadataRequest with basic options.
 
Method Summary
 String getBucketName()
          Gets the name of the bucket containing the object whose metadata is being retrieved.
 String getKey()
          Gets the key of the object whose metadata is being retrieved.
 String getVersionId()
          Gets the optional version ID of the object version whose metadata is being retrieved.
 void setBucketName(String bucketName)
          Sets the name of the bucket containing the object whose metadata is being retrieved.
 void setKey(String key)
          Sets the key of the object whose metadata is being retrieved.
 void setVersionId(String versionId)
          Sets the optional version ID of the object version whose metadata is being retrieved.
 GetObjectMetadataRequest withBucketName(String bucketName)
          Sets the name of the bucket containing the object whose metadata is being retrieved.
 GetObjectMetadataRequest withKey(String key)
          Sets the key of the object whose metadata is being retrieved.
 GetObjectMetadataRequest withVersionId(String versionId)
          Sets the optional version ID of the object version whose metadata is being retrieved.
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters, getDelegationToken, getRequestClientOptions, getRequestCredentials, setDelegationToken, setRequestCredentials
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetObjectMetadataRequest

public GetObjectMetadataRequest(String bucketName,
                                String key)
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(String bucketName, String key, String versionId)

GetObjectMetadataRequest

public GetObjectMetadataRequest(String bucketName,
                                String key,
                                String versionId)
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(String bucketName, String key)
Method Detail

getBucketName

public String getBucketName()
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(String bucketName), withBucketName(String)

setBucketName

public void setBucketName(String bucketName)
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(String)

withBucketName

public GetObjectMetadataRequest withBucketName(String 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(String bucketName)

getKey

public String getKey()
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(String), withKey(String)

setKey

public void setKey(String key)
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(String)

withKey

public GetObjectMetadataRequest withKey(String 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(String)

getVersionId

public String getVersionId()
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(String), withVersionId(String)

setVersionId

public void setVersionId(String versionId)
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(String)

withVersionId

public GetObjectMetadataRequest withVersionId(String 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(String)


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.