使用路径上传到 OpenStack Multipart

Uploading to OpenStack Multipart With Path

我正在使用 java Jclouds 上传到 OpenStack Swift 中的容器,上传在根目录下正常,但是当我传递一个路径(包含文件夹然后是文件),文件已上传,但还会创建另一个与该文件同名的文件夹。原文件名是8mb.bin

密码是:

try {
    ByteSource fileBytes = Files.asByteSource(file);
    File file = new File(filePath);
    String name = "test/test2/" + file.getName();
    Blob blob = blobStore.blobBuilder(name)
        .userMetadata(ImmutableMap.of("ContentType", contentType, "test", String.valueOf(test)))
        .payload(fileBytes)
        .contentLength(file.length())
        .contentType(contentType)
        .build();

    ///sednig the request
    blobStore.putBlob(ContainerName, blob, multipart());
    return contentLength;    
}

在指定的路径下是这样的:

文件夹 8mb.bin 中有路径 /slo/1522766773.076000/8200000/33554432,然后是一个名为 00000000 的文件,其大小与原始文件大小相同。

如何解决这个问题?

谢谢

jclouds implements Swift multipart using Static Large Objects. This has the limitation that parts exist in the same namespace as the manifest and modifying or deleting the parts invalidates the manifest. JCLOUDS-1285 建议将部件放在另一个容器中以清理对象列表,尽管这需要一些额外的删除和覆盖逻辑。