Java 类com.amazonaws.services.s3.model.CopyPartResult 实例源码

项目:ibm-cos-sdk-java    文件:S3CryptoModuleBase.java   
@Override
public final CopyPartResult copyPartSecurely(CopyPartRequest copyPartRequest) {
    String uploadId = copyPartRequest.getUploadId();
    T uploadContext = multipartUploadContexts.get(uploadId);
    CopyPartResult result = s3.copyPart(copyPartRequest);

    if (uploadContext != null && !uploadContext.hasFinalPartBeenSeen())
        uploadContext.setHasFinalPartBeenSeen(true);
    return result;
}
项目:ibm-cos-sdk-java    文件:CryptoModuleDispatcher.java   
@Override
public CopyPartResult copyPartSecurely(CopyPartRequest req) {
    return defaultCryptoMode == EncryptionOnly 
         ? eo.copyPartSecurely(req)
         : ae.copyPartSecurely(req)
         ;
}
项目:backuprotator    文件:AWSHandler.java   
static List<PartETag> GetETags(List<CopyPartResult> responses)
{
    List<PartETag> etags = new ArrayList<PartETag>();
    for (CopyPartResult response : responses)
    {
        etags.add(new PartETag(response.getPartNumber(), response.getETag()));
    }
    return etags;
}
项目:elasticsearch_my    文件:AmazonS3Wrapper.java   
@Override
public CopyPartResult copyPart(CopyPartRequest copyPartRequest) throws AmazonClientException, AmazonServiceException {
    return delegate.copyPart(copyPartRequest);
}
项目:ibm-cos-sdk-java    文件:AmazonS3EncryptionClient.java   
@Override
public CopyPartResult copyPart(CopyPartRequest copyPartRequest) {
    return crypto.copyPartSecurely(copyPartRequest);
}
项目:ibm-cos-sdk-java    文件:AmazonS3EncryptionClient.java   
@Override
public CopyPartResult copyPart(CopyPartRequest req) {
    return AmazonS3EncryptionClient.super.copyPart(req);
}
项目:S3Decorators    文件:S3Decorator.java   
@Override
public CopyPartResult copyPart(CopyPartRequest copyPartRequest) {
  return call(() -> getDelegate().copyPart(copyPartRequest));
}
项目:backuprotator    文件:AWSHandler.java   
private CompleteMultipartUploadResult copyMultipartFile(Bucket srcBucket, Bucket targetBucket, String fileName,
        long size) {
    // Create lists to hold copy responses
    List<CopyPartResult> copyResponses =
            new ArrayList<CopyPartResult>();

    // Step 2: Initialize
    InitiateMultipartUploadRequest initiateRequest = 
            new InitiateMultipartUploadRequest(targetBucket.getName(), targetBucket.getPath() + SEPARATOR + fileName);

    InitiateMultipartUploadResult initResult = 
            s3Client.initiateMultipartUpload(initiateRequest);

     // Step 4. Copy parts.
    long partSize = 5 * (long)Math.pow(2.0, 20.0); // 5 MB
    long bytePosition = 0;
    for (int i = 1; bytePosition < size; i++)
    {
        // Step 5. Save copy response.
        CopyPartRequest copyRequest = new CopyPartRequest()
           .withDestinationBucketName(targetBucket.getName())
           .withDestinationKey(targetBucket.getPath() + SEPARATOR + fileName)
           .withSourceBucketName(srcBucket.getName())
           .withSourceKey(srcBucket.getPath() + SEPARATOR + fileName)
           .withUploadId(initResult.getUploadId())
           .withFirstByte(bytePosition)
           .withLastByte(bytePosition + partSize -1 >= size ? size - 1 : bytePosition + partSize - 1) 
           .withPartNumber(i);

        copyResponses.add(s3Client.copyPart(copyRequest));
        bytePosition += partSize;
    }
    CompleteMultipartUploadRequest completeRequest = new 
            CompleteMultipartUploadRequest(
                    targetBucket.getName(),
                    targetBucket.getPath() + SEPARATOR + fileName,
                    initResult.getUploadId(),
                    GetETags(copyResponses));
    // Step 7. Complete copy operation.
    CompleteMultipartUploadResult completeUploadResponse =
        s3Client.completeMultipartUpload(completeRequest);
    return completeUploadResponse;
}
项目:presto    文件:MockAmazonS3.java   
@Override
public CopyPartResult copyPart(CopyPartRequest copyPartRequest)
        throws AmazonClientException
{
    return null;
}
项目:s3proxy    文件:AwsSdkTest.java   
@Test
public void testMultipartCopy() throws Exception {
    // B2 requires two parts to issue an MPU
    assumeTrue(!blobStoreType.equals("b2"));

    String sourceBlobName = "testMultipartCopy-source";
    String targetBlobName = "testMultipartCopy-target";

    ObjectMetadata metadata = new ObjectMetadata();
    metadata.setContentLength(BYTE_SOURCE.size());
    client.putObject(containerName, sourceBlobName,
            BYTE_SOURCE.openStream(), metadata);

    InitiateMultipartUploadRequest initiateRequest =
            new InitiateMultipartUploadRequest(containerName,
                    targetBlobName);
    InitiateMultipartUploadResult initResult =
            client.initiateMultipartUpload(initiateRequest);
    String uploadId = initResult.getUploadId();

    CopyPartRequest copyRequest = new CopyPartRequest()
            .withDestinationBucketName(containerName)
            .withDestinationKey(targetBlobName)
            .withSourceBucketName(containerName)
            .withSourceKey(sourceBlobName)
            .withUploadId(uploadId)
            .withFirstByte(0L)
            .withLastByte(BYTE_SOURCE.size() - 1)
            .withPartNumber(1);
    CopyPartResult copyPartResult = client.copyPart(copyRequest);

    CompleteMultipartUploadRequest completeRequest =
            new CompleteMultipartUploadRequest(
                    containerName, targetBlobName, uploadId,
                    ImmutableList.of(copyPartResult.getPartETag()));
    CompleteMultipartUploadResult completeUploadResponse =
            client.completeMultipartUpload(completeRequest);

    S3Object object = client.getObject(containerName, targetBlobName);
    assertThat(object.getObjectMetadata().getContentLength()).isEqualTo(
            BYTE_SOURCE.size());
    try (InputStream actual = object.getObjectContent();
            InputStream expected = BYTE_SOURCE.openStream()) {
        assertThat(actual).hasContentEqualTo(expected);
    }
}
项目:Scribengin    文件:AmazonS3Mock.java   
@Override
public CopyPartResult copyPart(CopyPartRequest copyPartRequest) throws AmazonClientException, AmazonServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:ibm-cos-sdk-java    文件:S3Direct.java   
public abstract CopyPartResult copyPart(CopyPartRequest req);
项目:ibm-cos-sdk-java    文件:S3CryptoModule.java   
public abstract CopyPartResult copyPartSecurely(CopyPartRequest req);
项目:ibm-cos-sdk-java    文件:S3DirectSpi.java   
public CopyPartResult copyPart(CopyPartRequest req);