}
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 (Exception e) {
publishProgress(progressListener, ProgressEventType.TRANSFER_FAILED_EVENT);
glacier.abortMultipartUpload(new AbortMultipartUploadRequest(accountId, vaultName, uploadId));