com.baidubce.services.bos.model
Class GetObjectMetadataRequest

java.lang.Object
  extended by com.baidubce.model.AbstractBceRequest
      extended by com.baidubce.services.bos.model.GenericBucketRequest
          extended by com.baidubce.services.bos.model.GenericObjectRequest
              extended by com.baidubce.services.bos.model.GetObjectMetadataRequest

public class GetObjectMetadataRequest
extends GenericObjectRequest

Provides options for obtaining the metadata for the specified Baidu Bos 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 Baidu Bos.


Constructor Summary
GetObjectMetadataRequest(String bucketName, String key)
          Constructs a new GetObjectMetadataRequest used to retrieve a specified object's metadata.
 
Method Summary
 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 withRequestCredentials(BceCredentials credentials)
           
 
Methods inherited from class com.baidubce.services.bos.model.GenericObjectRequest
getKey, setKey
 
Methods inherited from class com.baidubce.services.bos.model.GenericBucketRequest
getBucketName, setBucketName
 
Methods inherited from class com.baidubce.model.AbstractBceRequest
getRequestCredentials, setRequestCredentials
 
Methods inherited from class java.lang.Object
clone, equals, finalize, 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.
Method Detail

withRequestCredentials

public GetObjectMetadataRequest withRequestCredentials(BceCredentials credentials)
Specified by:
withRequestCredentials in class AbstractBceRequest

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.

Specified by:
withBucketName in class GenericBucketRequest
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.

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.

Specified by:
withKey in class GenericObjectRequest
Parameters:
key - The key of the object whose metadata is being retrieved.
Returns:
This GetObjectMetadataRequest, enabling additional method calls to be chained together.


Copyright © 2018. All rights reserved.