public PartETag call() throws Exception { if (calculateMd5) { request.withMD5Digest(computedMd5()); } PartETag partETag = s3.uploadPart(request).getPartETag(); return partETag; }
do { try { partETag = mClient.uploadPart(request).getPartETag(); return partETag; } catch (AmazonClientException e) {
.withPartSize(partSize) .withLastPart(isLastPart); partETags.add( getS3Client().uploadPart(uploadRequest).getPartETag() ); partNumber++;
partETags.add(s3.uploadPart(uploadPartRequest).getPartETag());
private Void uploadPart() throws AmazonClientException, BackupRestoreException { UploadPartRequest req = new UploadPartRequest(); req.setBucketName(dataPart.getBucketName()); req.setKey(dataPart.getS3key()); req.setUploadId(dataPart.getUploadID()); req.setPartNumber(dataPart.getPartNo()); req.setPartSize(dataPart.getPartData().length); req.setMd5Digest(SystemUtils.toBase64(dataPart.getMd5())); req.setInputStream(new ByteArrayInputStream(dataPart.getPartData())); UploadPartResult res = client.uploadPart(req); PartETag partETag = res.getPartETag(); if (!partETag.getETag().equals(SystemUtils.toHex(dataPart.getMd5()))) throw new BackupRestoreException( "Unable to match MD5 for part " + dataPart.getPartNo()); partETags.add(partETag); if (this.partsUploaded != null) this.partsUploaded.incrementAndGet(); return null; }
@Override public PartETag call() throws Exception { return s3.uploadPart(request).getPartETag(); } }
partETags.add(s3.uploadPart(uploadPartRequest).getPartETag());
.withFile(file) .withPartSize(partSize); partETags.add(s3Client.uploadPart(uploadRequest).getPartETag()); filePosition += partSize;
/** * Upload part of a multi-partition file. * <i>Important: this call does not close any input stream in the request.</i> * @param request request * @return the result of the operation * @throws AmazonClientException on problems */ public UploadPartResult uploadPart(UploadPartRequest request) throws AmazonClientException { try { UploadPartResult uploadPartResult = mClient.uploadPart(request); return uploadPartResult; } catch (AmazonClientException e) { throw e; } }
/** * Upload part of a multi-partition file. * <i>Important: this call does not close any input stream in the request.</i> * @param request request * @return the result of the operation * @throws AmazonClientException on problems */ public UploadPartResult uploadPart(UploadPartRequest request) throws AmazonClientException { try { UploadPartResult uploadPartResult = mClient.uploadPart(request); return uploadPartResult; } catch (AmazonClientException e) { throw e; } }
@Override public Boolean call() throws Exception { try { final UploadPartResult putPartResult = s3.uploadPart(request); dbUtil.updateState(request.getId(), TransferState.PART_COMPLETED); dbUtil.updateETag(request.getId(), putPartResult.getETag());
@Override public PartETag call() throws Exception { return s3.uploadPart(request).getPartETag(); } }
public PartETag call() throws Exception { PartETag partETag = s3.uploadPart(request).getPartETag(); return partETag; } }
@Override public UploadPartResult uploadPart(UploadPartRequest request) { return call(() -> getDelegate().uploadPart(request)); }
public void uploadPart(ByteArrayInputStream inputStream, int partSize) { int currentPartNumber = partETags.size() + 1; UploadPartRequest request = new UploadPartRequest() .withBucketName(bucket) .withKey(key) .withUploadId(uploadId) .withInputStream(inputStream) .withPartNumber(currentPartNumber) .withPartSize(partSize) .withGeneralProgressListener(progressListener); log.debug("Uploading part {} for id '{}'", currentPartNumber, uploadId); partETags.add(s3.uploadPart(request).getPartETag()); }
public void uploadPart(ByteArrayInputStream inputStream, int partSize) { int currentPartNumber = partETags.size() + 1; UploadPartRequest request = new UploadPartRequest() .withBucketName(bucket) .withKey(key) .withUploadId(uploadId) .withInputStream(inputStream) .withPartNumber(currentPartNumber) .withPartSize(partSize) .withGeneralProgressListener(progressListener); log.debug("Uploading part {} for id '{}'", currentPartNumber, uploadId); partETags.add(s3.uploadPart(request).getPartETag()); }
private void uploadStreamPart(StreamPart part) { log.debug("{}: Uploading {}", this, part); UploadPartRequest uploadRequest = new UploadPartRequest() .withBucketName(bucketName).withKey(putKey) .withUploadId(uploadId).withPartNumber(part.getPartNumber()) .withInputStream(part.getInputStream()) .withPartSize(part.size()); customiseUploadPartRequest(uploadRequest); UploadPartResult uploadPartResult = s3Client.uploadPart(uploadRequest); PartETag partETag = uploadPartResult.getPartETag(); partETags.add(partETag); log.info("{}: Finished uploading {}", this, part); }
@Override public UploadPartResult call() throws Exception { try { return this.amazonS3.uploadPart(new UploadPartRequest().withBucketName(this.bucketName). withKey(this.key). withUploadId(this.uploadId). withInputStream(new ByteArrayInputStream(this.content)). withPartNumber(this.partNumber). withLastPart(this.last). withPartSize(this.contentLength)); } finally { //Release the memory, as the callable may still live inside the CompletionService which would cause // an exhaustive memory usage this.content = null; } } }
@Override public UploadPartResult call() throws Exception { try { return this.amazonS3.uploadPart(new UploadPartRequest().withBucketName(this.bucketName). withKey(this.key). withUploadId(this.uploadId). withInputStream(new ByteArrayInputStream(this.content)). withPartNumber(this.partNumber). withLastPart(this.last). withPartSize(this.contentLength)); } finally { //Release the memory, as the callable may still live inside the CompletionService which would cause // an exhaustive memory usage this.content = null; } } }
protected PartETag doUploadMultipart(S3BlobStore blobStore, String bucketName, String blobName, String uploadId, InputStream is, int length, boolean lastPart) throws AmazonS3Exception { UploadPartRequest request = new UploadPartRequest() .withBucketName(bucketName) .withKey(blobName) .withUploadId(uploadId) .withPartNumber(multipartChunks) .withInputStream(is) .withPartSize(length) .withLastPart(lastPart); UploadPartResult response = blobStore.client().uploadPart(request); return response.getPartETag(); }