/** * Sets the optional customer-provided server-side encryption key to use to * encrypt the object part being uploaded, and returns the updated request * object so that additional method calls can be chained together. * * @param sseKey * The optional customer-provided server-side encryption key to * use to encrypt the object part being uploaded. * * @return This updated request object so that additional method calls can * be chained together. */ public UploadPartRequest withSSECustomerKey(SSECustomerKey sseKey) { setSSECustomerKey(sseKey); return this; } /**
/** * Sets the optional customer-provided server-side encryption key to use to * encrypt the object part being uploaded, and returns the updated request * object so that additional method calls can be chained together. * * @param sseKey The optional customer-provided server-side encryption key * to use to encrypt the object part being uploaded. * @return This updated request object so that additional method calls can be * chained together. */ public UploadPartRequest withSSECustomerKey(SSECustomerKey sseKey) { setSSECustomerKey(sseKey); return this; } /**
TransferManager.appendMultipartUserAgent(req); if (sseCustomerKey != null) req.setSSECustomerKey(sseCustomerKey);
/** * Sets the optional customer-provided server-side encryption key to use to * encrypt the object part being uploaded, and returns the updated request * object so that additional method calls can be chained together. * * @param sseKey The optional customer-provided server-side encryption key * to use to encrypt the object part being uploaded. * @return This updated request object so that additional method calls can be * chained together. */ public UploadPartRequest withSSECustomerKey(SSECustomerKey sseKey) { setSSECustomerKey(sseKey); return this; } /**
/** * Sets the optional customer-provided server-side encryption key to use to * encrypt the object part being uploaded, and returns the updated request * object so that additional method calls can be chained together. * * @param sseKey * The optional customer-provided server-side encryption key to * use to encrypt the object part being uploaded. * * @return This updated request object so that additional method calls can * be chained together. */ public UploadPartRequest withSSECustomerKey(SSECustomerKey sseKey) { setSSECustomerKey(sseKey); return this; } /**
request.setSSECustomerKey(sseCustomerKey);
partRequest.setSSECustomerKey(new SSECustomerKey("testKey")); assertTrue(ServiceUtils.skipMd5CheckPerRequest(partRequest));
/** * Sets server side encryption parameters to the part upload * request when encryption is enabled. * @param request upload part request */ protected void setOptionalUploadPartRequestParameters( UploadPartRequest request) { switch (serverSideEncryptionAlgorithm) { case SSE_C: if (isNotBlank(getServerSideEncryptionKey(bucket, getConf()))) { request.setSSECustomerKey(generateSSECustomerKey()); } break; default: } }
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()); }
request.setSSECustomerKey(sseCustomerKey);
TransferManager.appendMultipartUserAgent(req); if (sseCustomerKey != null) req.setSSECustomerKey(sseCustomerKey);