我正在尝试使用 jclouds.openstack.swift API 从 swift 存储和检索二进制对象
问题:如何使用范围下载对象。
例如:
swiftApi = ContextBuilder.newBuilder(provider)
.endpoint("....")
.credentials(identity, credentials)
.modules(modules)
.buildApi(SwiftApi.class);
final ObjectApi objectApi =
swiftApi.objectApiInRegionForContainer(REGION, CONTAINER);
GetOptions getOptions =
GetOptions.Builder.range(0,10).range(100, 200);
SwiftObject obj = objectApi.get(OBJECT_NAME, getOptions);
Payload payload = obj.getPayload();
// ????? I expected a binary stream but i get something else
payload2.openStream()
当我将流转储为字符串时,我看到标题和 mime 部分到达,但我不明白如何访问数据