private String CompleteMultiPartUpload(String uploadId, String checksum) throws NoSuchAlgorithmException, IOException { File file = new File(localPath); CompleteMultipartUploadRequest compRequest = new CompleteMultipartUploadRequest() .withVaultName(vaultName) .withUploadId(uploadId) .withChecksum(checksum) .withArchiveSize(String.valueOf(file.length())); if (Thread.currentThread().isInterrupted()) { LGR.warning("upload job is interrupted."); return null; } return GlacierFrame.getClient(region).completeMultipartUpload(compRequest) .getArchiveId(); }
public String completeMultipartUpload(AWSCredentials awsCredentials, String region, String vault, String uploadId, long archiveSize, String archiveHash) { try { runtimeCredentialsProvider.setAwsCredentials(awsCredentials); amazonGlacier.setRegion(Region.getRegion(Regions.fromName(region))); CompleteMultipartUploadResult result = amazonGlacier.completeMultipartUpload(new CompleteMultipartUploadRequest(vault, uploadId, Long.toString(archiveSize), archiveHash)); return result.getArchiveId(); } catch (AmazonClientException e) { throw new OmakaseRuntimeException(e); } }
@Override public CompleteMultipartUploadResult complete(CompleteMultipartUploadRequest request, ResultCapture<CompleteMultipartUploadResult> extractor) { ActionResult result = resource.performAction("Complete", request, extractor); if (result == null) return null; return (CompleteMultipartUploadResult) result.getData(); }
@Override public CompleteMultipartUploadResult complete(String checksum, String archiveSize, ResultCapture<CompleteMultipartUploadResult> extractor) { CompleteMultipartUploadRequest request = new CompleteMultipartUploadRequest() .withChecksum(checksum) .withArchiveSize(archiveSize); return complete(request, extractor); }
@Override public CompleteMultipartUploadResult complete(CompleteMultipartUploadRequest request) { return complete(request, null); }
/** * Performs the <code>Complete</code> action. * * <p> * The following request parameters will be populated from the data of this * <code>MultipartUpload</code> resource, and any conflicting parameter * value set in the request will be overridden: * <ul> * <li> * <b><code>AccountId</code></b> * - mapped from the <code>AccountId</code> identifier. * </li> * <li> * <b><code>VaultName</code></b> * - mapped from the <code>VaultName</code> identifier. * </li> * <li> * <b><code>UploadId</code></b> * - mapped from the <code>Id</code> identifier. * </li> * </ul> * * <p> * * @return The response of the low-level client operation associated with * this resource action. * @see CompleteMultipartUploadRequest */ CompleteMultipartUploadResult complete(CompleteMultipartUploadRequest request);
/** * Performs the <code>Complete</code> action and use a ResultCapture to * retrieve the low-level client response. * * <p> * The following request parameters will be populated from the data of this * <code>MultipartUpload</code> resource, and any conflicting parameter * value set in the request will be overridden: * <ul> * <li> * <b><code>AccountId</code></b> * - mapped from the <code>AccountId</code> identifier. * </li> * <li> * <b><code>VaultName</code></b> * - mapped from the <code>VaultName</code> identifier. * </li> * <li> * <b><code>UploadId</code></b> * - mapped from the <code>Id</code> identifier. * </li> * </ul> * * <p> * * @return The response of the low-level client operation associated with * this resource action. * @see CompleteMultipartUploadRequest */ CompleteMultipartUploadResult complete(CompleteMultipartUploadRequest request, ResultCapture<CompleteMultipartUploadResult> extractor);