【问题标题】:Unable to get Url from Jclouds BlobStore , S3Client无法从 Jclouds BlobStore 、 S3Client 获取 URL
【发布时间】:2015-07-20 14:02:15
【问题描述】:

在 blobStore 中存储 blob 后,它返回 Etag。但我希望 URL 访问 inputStream,就像 amazonS3Client.getUrl(bucketName, key); 在这里,我不想使用 AmazonS3Client,而是使用 Jcloud S3 客户端或 BlobStore。 有人做过吗? 或者在 Scality 中,我如何获取对象存储的 URL?

谢谢 SR

【问题讨论】:

    标签: java blobstore jclouds


    【解决方案1】:

    您可以通过两种方式执行此操作,具体取决于您是否拥有公共访问 blob 或想要授予对私有访问 blob 的临时访问权限。对于前者:

    URI publicUri = blobStoreContext.getBlobStore().blobMetadata(bucketName, key).getPublicUri();
    

    对于后者:

    URI privateUri = blobStoreContext.getSigner().signGetBlob(bucketName, key).getEndpoint();
    

    后者提供通过 HTTP 查询参数进行身份验证的限时 URI。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-07-19
      • 1970-01-01
      • 1970-01-01
      • 2021-05-16
      • 2014-12-27
      相关资源
      最近更新 更多