com.amazonaws.services.s3.model
Class DeleteObjectRequest

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

public class DeleteObjectRequest
extends AmazonWebServiceRequest

Provides options for deleting a specified object in a specified bucket. Once deleted, the object can only be restored if versioning was enabled when the object was deleted.

Note: If deleting an object that does not exist, Amazon S3 returns a success message, not an error message.

See Also:
deleteObject(String bucketName, String key), deleteObject(DeleteObjectRequest deleteObjectRequest)

Constructor Summary
DeleteObjectRequest(String bucketName, String key)
          Constructs a new DeleteObjectRequest, specifying the object's bucket name and key.
 
Method Summary
 String getBucketName()
          Gets the name of the Amazon S3 bucket containing the object to delete.
 String getKey()
          Gets the key of the object to delete.
 void setBucketName(String bucketName)
          Sets the name of the Amazon S3 bucket containing the object to delete.
 void setKey(String key)
          Sets the key of the object to delete.
 DeleteObjectRequest withBucketName(String bucketName)
          Sets the name of the Amazon S3 bucket containing the object to delete and returns this object, enabling additional method calls to be chained together.
 DeleteObjectRequest withKey(String key)
          Sets the key of the object to delete and returns this object, enabling additional method calls to be chained together.
 
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

DeleteObjectRequest

public DeleteObjectRequest(String bucketName,
                           String key)
Constructs a new DeleteObjectRequest, specifying the object's bucket name and key.

Parameters:
bucketName - The name of the Amazon S3 bucket containing the object to delete.
key - The key of the object to delete.
Method Detail

getBucketName

public String getBucketName()
Gets the name of the Amazon S3 bucket containing the object to delete.

Returns:
The name of the Amazon S3 bucket containing the object to delete.
See Also:
setBucketName(String)

setBucketName

public void setBucketName(String bucketName)
Sets the name of the Amazon S3 bucket containing the object to delete.

Parameters:
bucketName - The name of the Amazon S3 bucket containing the object to delete.
See Also:
getBucketName()

withBucketName

public DeleteObjectRequest withBucketName(String bucketName)
Sets the name of the Amazon S3 bucket containing the object to delete and returns this object, enabling additional method calls to be chained together.

Parameters:
bucketName - The name of the Amazon S3 bucket containing the object to delete.
Returns:
The updated DeleteObjectRequest object, enabling additional method calls to be chained together.

getKey

public String getKey()
Gets the key of the object to delete.

Returns:
The key of the object to delete.
See Also:
setKey(String)

setKey

public void setKey(String key)
Sets the key of the object to delete.

Parameters:
key - The key of the object to delete.
See Also:
getKey()

withKey

public DeleteObjectRequest withKey(String key)
Sets the key of the object to delete and returns this object, enabling additional method calls to be chained together.

Parameters:
key - The key of the object to delete.
Returns:
The updated DeleteObjectRequest object, enabling additional method calls to chained together.


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