Package com.amazonaws.services.glacier.model

Examples of com.amazonaws.services.glacier.model.CompleteMultipartUploadResult


            } // end outer while

            String checksum = TreeHashGenerator.calculateTreeHash(binaryChecksums);

            String archiveSize = Long.toString(file.length());
            CompleteMultipartUploadResult completeMultipartUploadResult =
                glacier.completeMultipartUpload(new CompleteMultipartUploadRequest()
                    .withAccountId(accountId)
                    .withArchiveSize(archiveSize)
                    .withVaultName(vaultName)
                    .withChecksum(checksum)
                    .withUploadId(uploadId));

            String artifactId = completeMultipartUploadResult.getArchiveId();
            publishProgress(progressListener, ProgressEventType.TRANSFER_COMPLETED_EVENT);
            return new UploadResult(artifactId);
        } catch (Throwable t) {
            publishProgress(progressListener, ProgressEventType.TRANSFER_FAILED_EVENT);
            glacier.abortMultipartUpload(new AbortMultipartUploadRequest(accountId, vaultName, uploadId));
View Full Code Here


          }

          String checksum = TreeHashGenerator.calculateTreeHash(binaryChecksums);

          String archiveSize = Long.toString(file.length());
          CompleteMultipartUploadResult completeMultipartUploadResult =
              glacier.completeMultipartUpload(new CompleteMultipartUploadRequest()
                  .withAccountId(accountId)
                  .withArchiveSize(archiveSize)
                  .withVaultName(vaultName)
                  .withChecksum(checksum)
                  .withUploadId(uploadId));

          String artifactId = completeMultipartUploadResult.getArchiveId();
          return new UploadResult(artifactId);
    } catch (Exception e) {
      glacier.abortMultipartUpload(new AbortMultipartUploadRequest(accountId, vaultName, uploadId));
      throw new AmazonClientException("Unable to finish the upload", e);
    }
View Full Code Here

            }

            String checksum = TreeHashGenerator.calculateTreeHash(binaryChecksums);

            String archiveSize = Long.toString(file.length());
            CompleteMultipartUploadResult completeMultipartUploadResult =
                glacier.completeMultipartUpload(new CompleteMultipartUploadRequest()
                    .withAccountId(accountId)
                    .withArchiveSize(archiveSize)
                    .withVaultName(vaultName)
                    .withChecksum(checksum)
                    .withUploadId(uploadId));

            String artifactId = completeMultipartUploadResult.getArchiveId();
            fireProgressEvent(progressListenerCallbackExecutor, ProgressEvent.COMPLETED_EVENT_CODE);
            return new UploadResult(artifactId);
        } catch (Exception e) {
            fireProgressEvent(progressListenerCallbackExecutor, ProgressEvent.FAILED_EVENT_CODE);
            glacier.abortMultipartUpload(new AbortMultipartUploadRequest(accountId, vaultName, uploadId));
View Full Code Here

            }

            String checksum = TreeHashGenerator.calculateTreeHash(binaryChecksums);

            String archiveSize = Long.toString(file.length());
            CompleteMultipartUploadResult completeMultipartUploadResult =
                glacier.completeMultipartUpload(new CompleteMultipartUploadRequest()
                    .withAccountId(accountId)
                    .withArchiveSize(archiveSize)
                    .withVaultName(vaultName)
                    .withChecksum(checksum)
                    .withUploadId(uploadId));

            String artifactId = completeMultipartUploadResult.getArchiveId();
            fireProgressEvent(progressListener, ProgressEvent.COMPLETED_EVENT_CODE);
            return new UploadResult(artifactId);
        } catch (Exception e) {
            fireProgressEvent(progressListener, ProgressEvent.FAILED_EVENT_CODE);
            glacier.abortMultipartUpload(new AbortMultipartUploadRequest(accountId, vaultName, uploadId));
View Full Code Here

            }

            String checksum = TreeHashGenerator.calculateTreeHash(binaryChecksums);

            String archiveSize = Long.toString(file.length());
            CompleteMultipartUploadResult completeMultipartUploadResult =
                glacier.completeMultipartUpload(new CompleteMultipartUploadRequest()
                    .withAccountId(accountId)
                    .withArchiveSize(archiveSize)
                    .withVaultName(vaultName)
                    .withChecksum(checksum)
                    .withUploadId(uploadId));

            String artifactId = completeMultipartUploadResult.getArchiveId();
            return new UploadResult(artifactId);
        } catch (Exception e) {
            glacier.abortMultipartUpload(new AbortMultipartUploadRequest(accountId, vaultName, uploadId));
            throw new AmazonClientException("Unable to finish the upload", e);
        }
View Full Code Here

            }

            String checksum = TreeHashGenerator.calculateTreeHash(binaryChecksums);

            String archiveSize = Long.toString(file.length());
            CompleteMultipartUploadResult completeMultipartUploadResult =
                glacier.completeMultipartUpload(new CompleteMultipartUploadRequest()
                    .withAccountId(accountId)
                    .withArchiveSize(archiveSize)
                    .withVaultName(vaultName)
                    .withChecksum(checksum)
                    .withUploadId(uploadId));

            String artifactId = completeMultipartUploadResult.getArchiveId();
            fireProgressEvent(progressListenerCallbackExecutor, ProgressEvent.COMPLETED_EVENT_CODE);
            return new UploadResult(artifactId);
        } catch (Exception e) {
            fireProgressEvent(progressListenerCallbackExecutor, ProgressEvent.FAILED_EVENT_CODE);
            glacier.abortMultipartUpload(new AbortMultipartUploadRequest(accountId, vaultName, uploadId));
View Full Code Here

    log.info(String.format("Multipart uploading %s (%s) to vault %s with part size %s (%s).", uploadFile.getName(),
        hTotalSize, vaultName, partSize, hPartSize));
    try {
      final String uploadId = this.initiateMultipartUpload(vaultName, partSize, uploadFile.getName());
      final String checksum = this.uploadParts(uploadId, uploadFile, vaultName, partSize);
      final CompleteMultipartUploadResult result = this.completeMultiPartUpload(uploadId, uploadFile, vaultName,
          checksum);

      log.info("Uploaded Archive ID: " + result.getArchiveId());
      log.info("Local Checksum: " + checksum);
      log.info("Remote Checksum: " + result.getChecksum());
      if (checksum.equals(result.getChecksum())) {
        log.info("Checksums are identical, upload succeeded.");
      } else {
        log.error("Checksums are different, upload failed.");
      }
View Full Code Here

  private CompleteMultipartUploadResult completeMultiPartUpload(String uploadId, File file, final String vaultName,
      String checksum) throws NoSuchAlgorithmException, IOException {
    CompleteMultipartUploadRequest compRequest = new CompleteMultipartUploadRequest().withVaultName(vaultName)
        .withUploadId(uploadId).withChecksum(checksum).withArchiveSize(String.valueOf(file.length()));

    CompleteMultipartUploadResult compResult = client.completeMultipartUpload(compRequest);

    return compResult;
  }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.glacier.model.CompleteMultipartUploadResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.