简体   繁体   中英

How to get a multi part object from openstack swift using jclouds

I am trying to store and retrieve binary objects from swift using jclouds.openstack.swift API

Question: How to download objects using ranges.

For example:

          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()

When i dump the stream as string i see headers and mime parts arriving but i don't understand how to access the data

jclouds 1.7.2不支持此功能,我报告了JCLOUDS-575来跟踪此问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM