Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   * Copyright 2013-2015, 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
  * or in the "license" file accompanying this file. This file is distributed
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
     private final ContentCryptoMaterial cekMaterial;
Can be used to enforce serial uploads.
     private int partNumber;
True if a multi-part upload is currently in progress; false otherwise.
     private volatile boolean partUploadInProgress;
     MultipartUploadCryptoContext(String bucketNameString key,
             ContentCryptoMaterial cekMaterial) {
         this. = cekMaterial;

Convenient method to return the content encrypting cipher lite (which is stateful) for the multi-part uploads.
     CipherLite getCipherLite() {
         return .getCipherLite();

Returns the content encrypting cryptographic material for the multi-part uploads.
         return ;

Can be used to check the next part number must either be the same (if it was an retry) or increment by exactly 1 during a serial part uploads.

As a side effect, the partUploadInProgress will be set to true upon successful completion of this method. Caller of this method is responsible to call endPartUpload() in a finally block once the respective part-upload is completed (either normally or abruptly).

com.amazonaws.AmazonClientException if parallel part upload is detected
See also:
     void beginPartUpload(final int nextPartNumber)
             throws AmazonClientException {
         if (nextPartNumber < 1)
             throw new IllegalArgumentException("part number must be at least 1");
         if () {
             throw new AmazonClientException(
                     "Parts are required to be uploaded in series");
         synchronized (this) {
             if (nextPartNumber -  <= 1) {
                  = nextPartNumber;
                  = true;
             } else {
                 throw new AmazonClientException(
                         "Parts are required to be uploaded in series (partNumber="
                                 +  + ", nextPartNumber="
                                 + nextPartNumber + ")");

Used to mark the completion of a part upload before the next. Should be invoked in a finally block, and must be preceded previously by a call to beginPartUpload(int).

     void endPartUpload() {
          = false;
New to GrepCode? Check out our FAQ X