Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2014-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;

This class is an extension of PutObjectRequest to allow additional encryption material description to be specified on a per-request basis.In particular, EncryptedPutObjectRequest is only recognized by com.amazonaws.services.s3.AmazonS3EncryptionClient.

If EncryptedPutObjectRequest is used against the non-encrypting com.amazonaws.services.s3.AmazonS3Client, the additional attributes will be ignored.

public class EncryptedPutObjectRequest extends PutObjectRequest implements
        MaterialsDescriptionProvider {
    
description of encryption materials to be used with this request.
    private Map<StringStringmaterialsDescription;
    public EncryptedPutObjectRequest(String bucketNameString keyFile file) {
        super(bucketNamekeyfile);
    }
    public EncryptedPutObjectRequest(String bucketNameString keyString redirectLocation) {
        super(bucketNamekeyredirectLocation);
    }
    public EncryptedPutObjectRequest(String bucketNameString keyInputStream inputObjectMetadata metadata) {
        super(bucketNamekeyinputmetadata);
    }
    
    @Override
    public Map<StringStringgetMaterialsDescription() {
        return ;
    }
    
    
sets the materials description for the encryption materials to be used with the current PutObjectRequest.

Parameters:
materialsDescription the materialsDescription to set
    public void setMaterialsDescription(Map<StringStringmaterialsDescription) {
        this. = materialsDescription == null
                ? null
                : Collections.unmodifiableMap(new HashMap<String,String>(materialsDescription))
                ;
    }
    
    
sets the materials description for the encryption materials to be used with the current PutObjectRequest.

Parameters:
materialsDescription the materialsDescription to set
    public EncryptedPutObjectRequest withMaterialsDescription(Map<StringStringmaterialsDescription) {
        setMaterialsDescription(materialsDescription);
        return this;
    }

    
Returns a clone (as deep as possible) of this request object.
    @Override
    public EncryptedPutObjectRequest clone() {
        final EncryptedPutObjectRequest cloned = 
            new EncryptedPutObjectRequest(
                getBucketName(), getKey(), getFile());
        super.copyPutObjectBaseTo(cloned);
        final Map<StringStringmaterialsDescription = getMaterialsDescription();
        cloned.withMaterialsDescription(materialsDescription == null
            ? null
            : new HashMap<StringString>(materialsDescription))
            ;
        return cloned;
    }
New to GrepCode? Check out our FAQ X