.withBucketName(bucketName) .withKey(uploadFileName) .withInputStream(chunk) .withPartNumber(partNumber) .withPartSize(partSize)
.withKey(key) .withUploadId(currentState.getUploadId()) .withInputStream(in) .withPartNumber(part) .withPartSize(thisPartSize);
.withKey(key) .withUploadId(uploadId) .withInputStream(new InputSubstream(wrappedStream, 0, partSize, isLastPart)) .withPartNumber(partNumber++) .withPartSize(partSize);
.withBucketName("test-bucket123456") .withKey("multi-key") .withInputStream(multipartContent); final Request<?> ur = new DefaultRequest(upr, Constants.S3_SERVICE_DISPLAY_NAME); ur.addHeader(Headers.CONTENT_LENGTH,
.withKey(key) .withUploadId(uploadId) .withInputStream( new InputSubstream(putObjectRequest.getInputStream(), 0, partSize, isLastPart))
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()); }
public void uploadPartAsync(ByteArrayInputStream inputStream, int partSize) { final int currentPartNumber = partETagsFutures.size() + 1; final UploadPartRequest request = new UploadPartRequest().withBucketName(bucket).withKey(key) .withUploadId(uploadId).withInputStream(inputStream) .withPartNumber(currentPartNumber).withPartSize(partSize); request.setGeneralProgressListener(progressListener); ListenableFuture<PartETag> partETagFuture = executorService.submit(new Callable<PartETag>() { @Override public PartETag call() throws Exception { if (LOG.isDebugEnabled()) { LOG.debug("Uploading part {} for id '{}'", currentPartNumber, uploadId); } return client.uploadPart(request).getPartETag(); } }); partETagsFutures.add(partETagFuture); }
private void flush() throws IOException { uploadBuffer.flip(); ByteArrayInputStream inputStream = new ByteArrayInputStream(uploadBuffer.array()); UploadPartRequest request = new UploadPartRequest() .withBucketName(path.getBucket()) .withKey(path.getKey()) .withUploadId(uploadId) .withPartNumber(partNumber++) .withPartSize(uploadBuffer.remaining()) .withMD5Digest(Base64.encodeAsString(md5.digest())) .withInputStream(inputStream); request.setSSECustomerKey(options.getSSECustomerKey()); UploadPartResult result; try { result = amazonS3.uploadPart(request); } catch (AmazonClientException e) { throw new IOException(e); } uploadBuffer.clear(); md5.reset(); eTags.add(result.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; } } }
upload.getUploadPartRequest().withInputStream(input).withPartSize(streamSize);
upload.getUploadPartRequest().withInputStream(input).withPartSize(streamSize);
.withUploadId(metaData.getUploadId()).withPartNumber(metaData.getPartNo()).withInputStream(bis).withPartSize(partSize); partETag = s3Client.uploadPart(uploadRequest).getPartETag(); } catch (Exception e) {
PartETag upload(String uploadId, S3Part part) { Object[] logParams = new Object[] { part.getSize(), part.getNumber(), bucket, key }; log.info("Uploading {} bytes for part {} to s3://{}/{}.", logParams); UploadPartRequest request = new UploadPartRequest() .withUploadId(uploadId) .withBucketName(bucket) .withKey(key) .withPartNumber(part.getNumber()) .withPartSize(part.getSize()) .withMD5Digest(part.getMd5()) .withInputStream(part.getInputStream()); UploadPartResult result = s3.uploadPart(request); log.info("Uploaded {} bytes for part {} to s3://{}/{}.", logParams); bytes += part.getSize(); return result.getPartETag(); }
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(); }
.withKey(key) .withUploadId(currentState.getUploadId()) .withInputStream(in) .withPartNumber(part) .withPartSize(thisPartSize);
.withKey(key) .withUploadId(uploadId) .withInputStream( new InputSubstream(putObjectRequest.getInputStream(), 0, partSize, isLastPart))
.withKey(key) .withUploadId(uploadId) .withInputStream(new InputSubstream(wrappedStream, 0, partSize, isLastPart)) .withPartNumber(partNumber++) .withPartSize(partSize);