本文整理了Java中org.jclouds.blobstore.BlobStore.completeMultipartUpload()
方法的一些代码示例,展示了BlobStore.completeMultipartUpload()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BlobStore.completeMultipartUpload()
方法的具体详情如下:
包路径:org.jclouds.blobstore.BlobStore
类名称:BlobStore
方法名:completeMultipartUpload
暂无
代码示例来源:origin: gaul/s3proxy
@Override
public String call() {
String farETag = delegate().completeMultipartUpload(mpu,
parts);
return farETag;
}
});
代码示例来源:origin: gaul/s3proxy
@Override
public String completeMultipartUpload(final MultipartUpload mpu,
final List<MultipartPart> parts) {
long length = 0;
for (MultipartPart part : parts) {
length += part.partSize();
}
byte[] array = Longs.toByteArray(length);
ByteSourcePayload payload = new ByteSourcePayload(
ByteSource.wrap(array));
super.abortMultipartUpload(mpu);
MultipartPart part = delegate().uploadMultipartPart(mpu, 1, payload);
return delegate().completeMultipartUpload(mpu, ImmutableList.of(part));
}
代码示例来源:origin: gaul/s3proxy
String eTag = blobStore.completeMultipartUpload(mpu, parts);
代码示例来源:origin: org.gaul/s3proxy
@Override
public String call() {
String farETag = delegate().completeMultipartUpload(mpu,
parts);
return farETag;
}
});
代码示例来源:origin: Nextdoor/bender
@Override
public String call() {
String farETag = delegate().completeMultipartUpload(mpu,
parts);
return farETag;
}
});
代码示例来源:origin: org.gaul/s3proxy
@Override
public void run() {
try {
eTag.set(blobStore.completeMultipartUpload(mpu, parts));
} catch (RuntimeException re) {
exception.set(re);
}
}
};
代码示例来源:origin: Nextdoor/bender
@Override
public String completeMultipartUpload(MultipartUpload mpu, List<MultipartPart> parts) {
return delegate().completeMultipartUpload(mpu, parts);
}
代码示例来源:origin: com.amysta.jclouds/jclouds-blobstore
@Override
public String completeMultipartUpload(MultipartUpload mpu, List<MultipartPart> parts) {
return delegate().completeMultipartUpload(mpu, parts);
}
代码示例来源:origin: org.apache.jclouds/jclouds-blobstore
@Override
public String completeMultipartUpload(MultipartUpload mpu, List<MultipartPart> parts) {
return delegate().completeMultipartUpload(mpu, parts);
}
代码示例来源:origin: apache/jclouds
@Override
public String completeMultipartUpload(MultipartUpload mpu, List<MultipartPart> parts) {
return delegate().completeMultipartUpload(mpu, parts);
}
代码示例来源:origin: Nextdoor/bender
@Override
public String completeMultipartUpload(final MultipartUpload mpu,
final List<MultipartPart> parts) {
long length = 0;
for (MultipartPart part : parts) {
length += part.partSize();
}
byte[] array = Longs.toByteArray(length);
ByteSourcePayload payload = new ByteSourcePayload(
ByteSource.wrap(array));
super.abortMultipartUpload(mpu);
MultipartPart part = delegate().uploadMultipartPart(mpu, 1, payload);
return delegate().completeMultipartUpload(mpu, ImmutableList.of(part));
}
代码示例来源:origin: Nextdoor/bender
String eTag = blobStore.completeMultipartUpload(mpu, parts);
代码示例来源:origin: apache/jclouds
@Test(groups = { "integration", "live" })
public void test10000PartMultipartUpload() throws Exception {
BlobStore blobStore = view.getBlobStore();
String container = getContainerName();
int partSize = (int) blobStore.getMinimumMultipartPartSize();
try {
String name = "blob-name";
BlobBuilder blobBuilder = blobStore.blobBuilder(name);
Blob blob = blobBuilder.build();
MultipartUpload mpu = blobStore.initiateMultipartUpload(container, blob.getMetadata(), new PutOptions());
ImmutableList.Builder<MultipartPart> parts = ImmutableList.builder();
byte[] content = new byte[partSize];
for (int i = 0; i < 10 * 1000; ++i) {
Payload payload = Payloads.newByteArrayPayload(content);
payload.getContentMetadata().setContentLength((long) partSize);
parts.add(blobStore.uploadMultipartPart(mpu, i, payload));
}
blobStore.completeMultipartUpload(mpu, parts.build());
BlobMetadata newBlobMetadata = blobStore.blobMetadata(container, name);
assertThat(newBlobMetadata.getSize()).isEqualTo(10 * 1000 * partSize);
} finally {
returnContainer(container);
}
}
代码示例来源:origin: apache/jclouds
@Test(groups = { "integration", "live" })
public void testMultipartUploadMultiplePartsKnownETag() throws Exception {
BlobStore blobStore = view.getBlobStore();
String container = getContainerName();
// Pre-computed ETag returned by AWS S3 for the MPU consisting of two 5MB parts filled with 'b'
String expectedETag = "\"84462a16f6a60478d50148808aa609c1-2\"";
int partSize = 5 * 1024 * 1024;
try {
String name = "blob-name";
BlobBuilder blobBuilder = blobStore.blobBuilder(name);
Blob blob = blobBuilder.build();
MultipartUpload mpu = blobStore.initiateMultipartUpload(container, blob.getMetadata(), new PutOptions());
byte[] content = new byte[partSize];
Arrays.fill(content, (byte) 'b');
Payload payload = Payloads.newByteArrayPayload(content);
payload.getContentMetadata().setContentLength((long) partSize);
MultipartPart part1 = blobStore.uploadMultipartPart(mpu, 1, payload);
MultipartPart part2 = blobStore.uploadMultipartPart(mpu, 2, payload);
blobStore.completeMultipartUpload(mpu, ImmutableList.of(part1, part2));
BlobMetadata newBlobMetadata = blobStore.blobMetadata(container, name);
assertThat(newBlobMetadata.getETag()).isEqualTo(expectedETag);
} finally {
returnContainer(container);
}
}
代码示例来源:origin: apache/jclouds
blobStore.completeMultipartUpload(mpu, ImmutableList.of(part));
代码示例来源:origin: apache/jclouds
blobStore.completeMultipartUpload(mpu, ImmutableList.of(part1, part2));
代码示例来源:origin: apache/jclouds
assertThat(uploads).hasSize(1);
blobStore.completeMultipartUpload(mpu, ImmutableList.of(part1, part2));
mpu = null;
内容来源于网络,如有侵权,请联系作者删除!