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.ec2.model;
 

Describes the storage parameters for S3 and S3 buckets for an instance store-backed AMI.

 
 public class S3Storage implements SerializableCloneable {

    
The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.
 
     private String bucket;

    
The beginning of the file name of the AMI.
 
     private String prefix;

    
The access key ID of the owner of the bucket. Before you specify a value for your access key ID, review and follow the guidance in Best Practices for Managing AWS Access Keys.
 
     private String aWSAccessKeyId;

    
A Base64-encoded Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.
 
     private String uploadPolicy;

    
The signature of the Base64 encoded JSON document.
 
     private String uploadPolicySignature;

    
The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.

Returns:
The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.
 
     public String getBucket() {
         return ;
     }
    
    
The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.

Parameters:
bucket The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.
 
     public void setBucket(String bucket) {
         this. = bucket;
     }
    
    
The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.

Returns a reference to this object so that method calls can be chained together.

Parameters:
bucket The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.
Returns:
A reference to this updated object so that method calls can be chained together.
    public S3Storage withBucket(String bucket) {
        this. = bucket;
        return this;
    }

    
The beginning of the file name of the AMI.

Returns:
The beginning of the file name of the AMI.
    public String getPrefix() {
        return ;
    }
    
    
The beginning of the file name of the AMI.

Parameters:
prefix The beginning of the file name of the AMI.
    public void setPrefix(String prefix) {
        this. = prefix;
    }
    
    
The beginning of the file name of the AMI.

Returns a reference to this object so that method calls can be chained together.

Parameters:
prefix The beginning of the file name of the AMI.
Returns:
A reference to this updated object so that method calls can be chained together.
    public S3Storage withPrefix(String prefix) {
        this. = prefix;
        return this;
    }

    
The access key ID of the owner of the bucket. Before you specify a value for your access key ID, review and follow the guidance in Best Practices for Managing AWS Access Keys.

Returns:
The access key ID of the owner of the bucket. Before you specify a value for your access key ID, review and follow the guidance in Best Practices for Managing AWS Access Keys.
    public String getAWSAccessKeyId() {
        return ;
    }
    
    
The access key ID of the owner of the bucket. Before you specify a value for your access key ID, review and follow the guidance in Best Practices for Managing AWS Access Keys.

Parameters:
aWSAccessKeyId The access key ID of the owner of the bucket. Before you specify a value for your access key ID, review and follow the guidance in Best Practices for Managing AWS Access Keys.
    public void setAWSAccessKeyId(String aWSAccessKeyId) {
        this. = aWSAccessKeyId;
    }
    
    
The access key ID of the owner of the bucket. Before you specify a value for your access key ID, review and follow the guidance in Best Practices for Managing AWS Access Keys.

Returns a reference to this object so that method calls can be chained together.

Parameters:
aWSAccessKeyId The access key ID of the owner of the bucket. Before you specify a value for your access key ID, review and follow the guidance in Best Practices for Managing AWS Access Keys.
Returns:
A reference to this updated object so that method calls can be chained together.
    public S3Storage withAWSAccessKeyId(String aWSAccessKeyId) {
        this. = aWSAccessKeyId;
        return this;
    }

    
A Base64-encoded Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.

Returns:
A Base64-encoded Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.
    public String getUploadPolicy() {
        return ;
    }
    
    
A Base64-encoded Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.

Parameters:
uploadPolicy A Base64-encoded Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.
    public void setUploadPolicy(String uploadPolicy) {
        this. = uploadPolicy;
    }
    
    
A Base64-encoded Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.

Returns a reference to this object so that method calls can be chained together.

Parameters:
uploadPolicy A Base64-encoded Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on your behalf.
Returns:
A reference to this updated object so that method calls can be chained together.
    public S3Storage withUploadPolicy(String uploadPolicy) {
        this. = uploadPolicy;
        return this;
    }

    
The signature of the Base64 encoded JSON document.

Returns:
The signature of the Base64 encoded JSON document.
    public String getUploadPolicySignature() {
        return ;
    }
    
    
The signature of the Base64 encoded JSON document.

Parameters:
uploadPolicySignature The signature of the Base64 encoded JSON document.
    public void setUploadPolicySignature(String uploadPolicySignature) {
        this. = uploadPolicySignature;
    }
    
    
The signature of the Base64 encoded JSON document.

Returns a reference to this object so that method calls can be chained together.

Parameters:
uploadPolicySignature The signature of the Base64 encoded JSON document.
Returns:
A reference to this updated object so that method calls can be chained together.
    public S3Storage withUploadPolicySignature(String uploadPolicySignature) {
        this. = uploadPolicySignature;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getBucket() != nullsb.append("Bucket: " + getBucket() + ",");
        if (getPrefix() != nullsb.append("Prefix: " + getPrefix() + ",");
        if (getAWSAccessKeyId() != nullsb.append("AWSAccessKeyId: " + getAWSAccessKeyId() + ",");
        if (getUploadPolicy() != nullsb.append("UploadPolicy: " + getUploadPolicy() + ",");
        if (getUploadPolicySignature() != nullsb.append("UploadPolicySignature: " + getUploadPolicySignature() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getBucket() == null) ? 0 : getBucket().hashCode()); 
        hashCode = prime * hashCode + ((getPrefix() == null) ? 0 : getPrefix().hashCode()); 
        hashCode = prime * hashCode + ((getAWSAccessKeyId() == null) ? 0 : getAWSAccessKeyId().hashCode()); 
        hashCode = prime * hashCode + ((getUploadPolicy() == null) ? 0 : getUploadPolicy().hashCode()); 
        hashCode = prime * hashCode + ((getUploadPolicySignature() == null) ? 0 : getUploadPolicySignature().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof S3Storage == falsereturn false;
        S3Storage other = (S3Storage)obj;
        
        if (other.getBucket() == null ^ this.getBucket() == nullreturn false;
        if (other.getBucket() != null && other.getBucket().equals(this.getBucket()) == falsereturn false
        if (other.getPrefix() == null ^ this.getPrefix() == nullreturn false;
        if (other.getPrefix() != null && other.getPrefix().equals(this.getPrefix()) == falsereturn false
        if (other.getAWSAccessKeyId() == null ^ this.getAWSAccessKeyId() == nullreturn false;
        if (other.getAWSAccessKeyId() != null && other.getAWSAccessKeyId().equals(this.getAWSAccessKeyId()) == falsereturn false
        if (other.getUploadPolicy() == null ^ this.getUploadPolicy() == nullreturn false;
        if (other.getUploadPolicy() != null && other.getUploadPolicy().equals(this.getUploadPolicy()) == falsereturn false
        if (other.getUploadPolicySignature() == null ^ this.getUploadPolicySignature() == nullreturn false;
        if (other.getUploadPolicySignature() != null && other.getUploadPolicySignature().equals(this.getUploadPolicySignature()) == falsereturn false
        return true;
    }
    
    @Override
    public S3Storage clone() {
        try {
            return (S3Storagesuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X