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;
 
 import java.io.File;
 import java.util.Map;
 
Used to request the client-side encryption and upload of a large S3 object via pipelined parallel multi-part uploads.

 
 public class UploadObjectRequest extends AbstractPutObjectRequest implements
         MaterialsDescriptionProvider {
     static final int MIN_PART_SIZE = 5 << 20; // 5 MB
 
    
Optional metadata to be included in each upload part requests.
 
     private ObjectMetadata uploadPartMetadata;
    
description of encryption materials to be used with this request.
 
     private Map<StringStringmaterialsDescription;
    
Part size (in bytes). Default is MIN_PART_SIZE. This part size will be used as a reference for the multi-part uploads but the physical part size may vary.
 
     private long partSize = ;
    
Optional configuration of a custom thread pool used for concurrent uploads.
 
     private ExecutorService executorService;
    
Optional configuration of a custom mutli-file output stream used for generating multiple parts for ciphertext.
 
     private MultiFileOutputStream multiFileOutputStream;
    
Optional configuration of an object observer for advanced customization.
 
     private UploadObjectObserver uploadObjectObserver;

    
Limitation (in bytes) on temporary disk space consumption for this request; must be at least twice the amount of the specified partSize. The default is java.lang.Long.MAX_VALUE.
 
     private long diskLimit = .;
 
     public UploadObjectRequest(String bucketNameString keyFile file) {
         super(bucketNamekeyfile);
     }
 
     public UploadObjectRequest(String bucketNameString key,
             InputStream inputObjectMetadata metadata) {
         super(bucketNamekeyinputmetadata);
     }

    
Returns the part-size used for muti-part upload for this request. This part size will be used as a reference for the multi-part uploads but the physical part size may vary.
 
     public long getPartSize() {
         return ;
     }

    
Configured the part size for multi-part upload. Must be at least MIN_PART_SIZE. This part size will be used as a reference for the multi-part uploads but the physical part size may vary.

Returns:
this object for method chaining purposes
 
     public UploadObjectRequest withPartSize(long partSize) {
         if (partSize < )
            throw new IllegalArgumentException("partSize must be at least "
                    + );
        this. = partSize;
        return this;
    }

    
Returns the maximum size (in bytes) of additional disk space that will be consumed for this request; or java.lang.Long.MAX_VALUE if there is no limit.
    public long getDiskLimit() {
        return ;
    }

    
Configured the maximum disk space (in bytes) that will be consumed for this request. The maximum disk space must be at least twice the size of partSize.

Returns:
this object for method chaining purposes
    public UploadObjectRequest withDiskLimit(long diskLimit) {
        this. = diskLimit;
        return this;
    }

    
Returns a custom executor service for concurrent uploads; or null there is no customization.
        return ;
    }

    
Configure a custom executor service for concurrent uploads.

Returns:
this object for method chaining purposes
    public UploadObjectRequest withExecutorService(ExecutorService executorService) {
        this. = executorService;
        return this;
    }

    
Returns a custom multi-file output stream; or null if the default is to be used.
        return ;
    }

    
Configure a custom multi-file output stream; or null if the default is to be used.

Returns:
this object for method chaining purposes
            MultiFileOutputStream multiFileOutputStream) {
        this. = multiFileOutputStream;
        return this;
    }

    
Returns a custom upload-object observer; or null there is no customization.
        return ;
    }

    
Configure a custom upload-object observer; or null if the default is to be used.

Returns:
this object for method chaining purposes
            UploadObjectObserver uploadObjectObserver) {
        this. = uploadObjectObserver;
        return this;
    }
    @Override
    public Map<StringStringgetMaterialsDescription() {
        return ;
    }

    
Sets the materials description for the encryption materials to be used with the current request.

Parameters:
materialsDescription the materialsDescription to set
    public void setMaterialsDescription(Map<StringStringmaterialsDescription) {
        this. = materialsDescription == null
            ? null
            : Collections.unmodifiableMap(
                new HashMap<StringString>(materialsDescription));
    }

    
            Map<StringStringmaterialsDescription) {
        setMaterialsDescription(materialsDescription);
        return this;
    }

    
Gets the optional metadata to be included in each UploadPart request.
        return ;
    }

    
Sets the optional metadata to be included in each UploadPart request.
    public void setUploadPartMetadata(ObjectMetadata partUploadMetadata) {
        this. = partUploadMetadata;
    }

    
    public <T extends UploadObjectRequest> T withUploadPartMetadata(
            ObjectMetadata partUploadMetadata) {
        setUploadPartMetadata(partUploadMetadata);
        @SuppressWarnings("unchecked") T t = (T)this;
        return t;
    }

    
Returns a clone (as deep as possible) of this request object.
    @Override
    public UploadObjectRequest clone() {
        final UploadObjectRequest cloned = new UploadObjectRequest(
                getBucketName(), getKey(), getFile());
        super.copyPutObjectBaseTo(cloned);
        final Map<StringStringmaterialsDescription = getMaterialsDescription();
        final ObjectMetadata uploadPartMetadata = getUploadPartMetadata();
        return cloned
                .withMaterialsDescription(materialsDescription == null
                    ? null
                    : new HashMap<StringString>(materialsDescription))
                .withDiskLimit(getDiskLimit())
                .withExecutorService(getExecutorService())
                .withMultiFileOutputStream(getMultiFileOutputStream())
                .withPartSize(getPartSize())
                .withUploadObjectObserver(getUploadObjectObserver())
                .withUploadPartMetadata(uploadPartMetadata == null
                    ? null : uploadPartMetadata.clone())
                ;
    }
New to GrepCode? Check out our FAQ X