/** * Throws {@link IllegalArgumentException} if SSE customer key is in use * without https. */ private void checkHttps(AmazonWebServiceRequest req) { if (req instanceof SSECustomerKeyProvider) { SSECustomerKeyProvider p = (SSECustomerKeyProvider) req; if (p.getSSECustomerKey() != null) assertHttps(); } else if (req instanceof CopyObjectRequest) { CopyObjectRequest cor = (CopyObjectRequest) req; if (cor.getSourceSSECustomerKey() != null || cor.getDestinationSSECustomerKey() != null) { assertHttps(); } } else if (req instanceof CopyPartRequest) { CopyPartRequest cpr = (CopyPartRequest) req; if (cpr.getSourceSSECustomerKey() != null || cpr.getDestinationSSECustomerKey() != null) { assertHttps(); } } if (req instanceof SSEAwsKeyManagementParamsProvider) { SSEAwsKeyManagementParamsProvider p = (SSEAwsKeyManagementParamsProvider) req; if (p.getSSEAwsKeyManagementParams() != null) assertHttps(); } }
.withFirstByte(Long.valueOf(offset)) .withLastByte(Long.valueOf(offset + partSize - 1)) .withSourceSSECustomerKey(origReq.getSourceSSECustomerKey()) .withDestinationSSECustomerKey(origReq.getDestinationSSECustomerKey()) .withRequesterPays(origReq.isRequesterPays())
.withSSECustomerKey(copyObjectRequest.getSourceSSECustomerKey()) .withRequesterPays(copyObjectRequest.isRequesterPays()) .withVersionId(copyObjectRequest.getSourceVersionId());
populateSourceSSE_C(request, copyObjectRequest.getSourceSSECustomerKey()); populateSSE_C(request, copyObjectRequest.getDestinationSSECustomerKey());
/** * Constructs a copy part requests and returns it. * * @return Returns a new copy part request */ public synchronized CopyPartRequest getNextCopyPartRequest() { long partSize = Math.min(optimalPartSize, remainingBytes); CopyPartRequest request = new CopyPartRequest() .withSourceBucketName(copyObjectRequest.getSourceBucketName()) .withSourceKey(copyObjectRequest.getSourceKey()) .withUploadId(uploadId) .withPartNumber(partNumber++) .withDestinationBucketName( copyObjectRequest.getDestinationBucketName()) .withDestinationKey(copyObjectRequest.getDestinationKey()) .withSourceVersionId(copyObjectRequest.getSourceVersionId()) .withFirstByte(new Long(offset)) .withLastByte(new Long(offset + partSize - 1)) .withSourceSSECustomerKey(copyObjectRequest.getSourceSSECustomerKey()) .withDestinationSSECustomerKey(copyObjectRequest.getDestinationSSECustomerKey()); setOtherMetadataInRequest(request); offset += partSize; remainingBytes -= partSize; return request; }
copyObjectRequest.getSourceBucketName(), copyObjectRequest.getSourceKey()) .withSSECustomerKey(copyObjectRequest.getSourceSSECustomerKey());
populateSourceSSE_C(request, copyObjectRequest.getSourceSSECustomerKey()); populateSSE_C(request, copyObjectRequest.getDestinationSSECustomerKey());
/** * Constructs a copy part requests and returns it. * * @return Returns a new copy part request */ public synchronized CopyPartRequest getNextCopyPartRequest() { long partSize = Math.min(optimalPartSize, remainingBytes); CopyPartRequest request = new CopyPartRequest() .withSourceBucketName(copyObjectRequest.getSourceBucketName()) .withSourceKey(copyObjectRequest.getSourceKey()) .withUploadId(uploadId) .withPartNumber(partNumber++) .withDestinationBucketName( copyObjectRequest.getDestinationBucketName()) .withDestinationKey(copyObjectRequest.getDestinationKey()) .withSourceVersionId(copyObjectRequest.getSourceVersionId()) .withFirstByte(new Long(offset)) .withLastByte(new Long(offset + partSize - 1)) .withSourceSSECustomerKey(copyObjectRequest.getSourceSSECustomerKey()) .withDestinationSSECustomerKey(copyObjectRequest.getDestinationSSECustomerKey()); setOtherMetadataInRequest(request); offset += partSize; remainingBytes -= partSize; return request; }
/** * Throws {@link IllegalArgumentException} if SSE customer key is in use * without https. */ private void checkHttps(AmazonWebServiceRequest req) { if (req instanceof SSECustomerKeyProvider) { SSECustomerKeyProvider p = (SSECustomerKeyProvider) req; if (p.getSSECustomerKey() != null) assertHttps(); } else if (req instanceof CopyObjectRequest) { CopyObjectRequest cor = (CopyObjectRequest) req; if (cor.getSourceSSECustomerKey() != null || cor.getDestinationSSECustomerKey() != null) { assertHttps(); } } else if (req instanceof CopyPartRequest) { CopyPartRequest cpr = (CopyPartRequest) req; if (cpr.getSourceSSECustomerKey() != null || cpr.getDestinationSSECustomerKey() != null) { assertHttps(); } } if (req instanceof SSEAwsKeyManagementParamsProvider) { SSEAwsKeyManagementParamsProvider p = (SSEAwsKeyManagementParamsProvider) req; if (p.getSSEAwsKeyManagementParams() != null) assertHttps(); } }
.withFirstByte(Long.valueOf(offset)) .withLastByte(Long.valueOf(offset + partSize - 1)) .withSourceSSECustomerKey(origReq.getSourceSSECustomerKey()) .withDestinationSSECustomerKey(origReq.getDestinationSSECustomerKey()) .withRequesterPays(origReq.isRequesterPays())
copyObjectRequest.getSourceBucketName(), copyObjectRequest.getSourceKey()) .withSSECustomerKey(copyObjectRequest.getSourceSSECustomerKey());
populateSourceSSE_C(request, copyObjectRequest.getSourceSSECustomerKey()); populateSSE_C(request, copyObjectRequest.getDestinationSSECustomerKey());
.withSSECustomerKey(copyObjectRequest.getSourceSSECustomerKey()) .withRequesterPays(copyObjectRequest.isRequesterPays()) .withVersionId(copyObjectRequest.getSourceVersionId());
populateSourceSSE_C(request, copyObjectRequest.getSourceSSECustomerKey()); populateSSE_C(request, copyObjectRequest.getDestinationSSECustomerKey());