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 deleting a specific version of an object in the specified bucket. Once deleted, there is no method to restore or undelete an object version. This is the only way to permanently delete object versions that are protected by versioning.

Because deleting an object version is permanent and irreversible, it is a privileged operation that only the owner of the bucket containing the version may perform.

An owner can only delete a version of an object if the owner has enabled versioning for their bucket. For more information about enabling versioning for a bucket, see com.amazonaws.services.s3.AmazonS3.setBucketVersioningConfiguration(com.amazonaws.services.s3.model.SetBucketVersioningConfigurationRequest).

Note: When attempting to delete an object that does not exist, Amazon S3 returns a success message, not an error message.

 
 public class DeleteVersionRequest extends AmazonWebServiceRequest {

    
The name of the Amazon S3 bucket containing the version to delete.
 
     private String bucketName;

    
The key of the object version to delete.
 
     private String key;

    
The version ID uniquely identifying which version of the object to delete.
 
     private String versionId;

    
The optional Multi-Factor Authentication information to include with this request. Multi-Factor Authentication is required when deleting a version from a bucket that has enabled MFA Delete in its bucket versioning configuration. See BucketVersioningConfiguration.setMfaDeleteEnabled(java.lang.Boolean) for more information on MFA Delete.
 
     private MultiFactorAuthentication mfa;

    
    
Constructs a new DeleteVersionRequest object, ready to be executed to delete the version identified by the specified version ID, in the specified bucket and key.

Parameters:
bucketName The name of the bucket containing the version to delete.
key The key of the object version to delete.
versionId The version ID identifying the version to delete.
See also:
DeleteVersionRequest.DeleteVersionRequest(java.lang.String,java.lang.String,java.lang.String,com.amazonaws.services.s3.model.MultiFactorAuthentication)
 
     public DeleteVersionRequest(String bucketNameString keyString versionId) {
         this. = bucketName;
         this. = key;
         this. = versionId;
     }

    
Constructs a new DeleteVersionRequest object, ready to be executed to delete the version identified by the specified version ID, in the specified bucket and key, with the specified Multi-Factor Authentication (MFA) information. Multi-Factor Authentication is required when the MFA Delete option has been enabled for a bucket's versioning configuration. See BucketVersioningConfiguration for more details on MFA Delete.

Parameters:
bucketName The name of the bucket containing the version to delete.
key The key of the object version to delete.
versionId The version ID uniquely identifying the version to delete.
mfa The Multi-Factor Authentication information to include in this request.
See also:
DeleteVersionRequest.DeleteVersionRequest(java.lang.String,java.lang.String,java.lang.String)
    public DeleteVersionRequest(String bucketNameString keyString versionIdMultiFactorAuthentication mfa) {
        this(bucketNamekeyversionId);
        this. = mfa;
    }
    
    
Gets the name of the Amazon S3 bucket containing the version to delete.

Returns:
The name of the Amazon S3 bucket containing the version to delete.
See also:
setBucketName(java.lang.String)
withBucketName(java.lang.String)
    public String getBucketName() {
        return ;
    }

    
Sets the name of the Amazon S3 bucket containing the version to delete.

Parameters:
bucketName The name of the Amazon S3 bucket containing the version to delete.
See also:
getBucketName()
withBucketName(java.lang.String)
    public void setBucketName(String bucketName) {
        this. = bucketName;
    }

    
Sets the name of the Amazon S3 bucket containing the version to delete. Returns this DeleteVersionRequest, enabling additional method calls to be chained together.

Parameters:
bucketName The name of the Amazon S3 bucket containing the version to delete.
Returns:
The updated DeleteVersionRequest object, enabling additional method calls to be chained together.
See also:
getBucketName()
setBucketName(java.lang.String)
    public DeleteVersionRequest withBucketName(String bucketName) {
        setBucketName(bucketName);
        return this;
    }

    
Gets the key of the version to delete.

Returns:
The key of the version to delete.
See also:
setKey(java.lang.String)
withKey(java.lang.String)
    public String getKey() {
        return ;
    }

    
Sets the key of the version to delete.

Parameters:
key The key of the version to delete.
See also:
getKey()
withKey(java.lang.String)
    public void setKey(String key) {
        this. = key;
    }

    
Sets the key of the version to delete Returns this DeleteVersionRequest, enabling additional method calls to be chained together.

Parameters:
key The key of the version to delete.
Returns:
This DeleteVersionRequest, enabling additional method calls to be chained together.
See also:
getKey()
setKey(java.lang.String)
    public DeleteVersionRequest withKey(String key) {
        setKey(key);
        return this;
    }

    
Gets the version ID uniquely identifying which version of the object to delete.

Returns:
The version ID uniquely identifying which version of the object to delete.
See also:
setVersionId(java.lang.String)
withVersionId(java.lang.String)
    public String getVersionId() {
        return ;
    }

    
Sets the version ID uniquely identifying which version of the object to delete.

Parameters:
versionId The version ID uniquely identifying which version of the object to delete.
See also:
getVersionId()
withVersionId(java.lang.String)
    public void setVersionId(String versionId) {
        this. = versionId;
    }

    
Sets the version ID uniquely identifying which version of the object to delete Returns this DeleteVersionRequest, enabling additional method calls to be chained together.

Parameters:
versionId The version ID uniquely identifying which version of the object to delete.
Returns:
This DeleteVersionRequest, enabling additional method calls to be chained together.
See also:
getVersionId()
setVersionId(java.lang.String)
    public DeleteVersionRequest withVersionId(String versionId) {
        setVersionId(versionId);
        return this;
    }

    

Gets the optional Multi-Factor Authentication information included with this request.

Multi-Factor Authentication is required when deleting an object version from a bucket which has MFADelete enabled in its bucket versioning configuration.

See BucketVersioningConfiguration.setMfaDeleteEnabled(java.lang.Boolean) for more information on MFADelete.

Returns:
The optional Multi-Factor Authentication information included with this request.
See also:
setMfa(com.amazonaws.services.s3.model.MultiFactorAuthentication)
withMfa(com.amazonaws.services.s3.model.MultiFactorAuthentication)
    public MultiFactorAuthentication getMfa() {
        return ;
    }

    

Sets the optional Multi-Factor Authentication information to include with this request.

Multi-Factor Authentication is required when deleting an object version from a bucket which has MFADelete enabled in its bucket versioning configuration.

See BucketVersioningConfiguration.setMfaDeleteEnabled(java.lang.Boolean) for more information on MFADelete.

Parameters:
mfa The optional Multi-Factor Authentication information to include with this request.
See also:
getMfa()
withMfa(com.amazonaws.services.s3.model.MultiFactorAuthentication)
    public void setMfa(MultiFactorAuthentication mfa) {
        this. = mfa;
    }

    

Sets the optional Multi-Factor Authentication information to include with this request Returns this DeleteVersionRequest, enabling additional method calls to be chained together.

Multi-Factor Authentication is required when deleting an object version from a bucket which has MFADelete enabled in its bucket versioning configuration

See BucketVersioningConfiguration.setMfaDeleteEnabled(java.lang.Boolean) for more information on MFADelete.

Parameters:
mfa The optional Multi-Factor Authentication information to include with this request.
Returns:
This DeleteVersionRequest, enabling additional method calls to be chained together.
See also:
getMfa()
withMfa(com.amazonaws.services.s3.model.MultiFactorAuthentication)
        setMfa(mfa);
        return this;
    }
New to GrepCode? Check out our FAQ X