【发布时间】:2012-12-10 19:33:14
【问题描述】:
我正在尝试将包含一些数据的集合存储到 blob 中(在云存储中,如 Rackspace CloudFiles 或 Amazon S3)
现在,这是用于将 set 变量实际存储到云提供商中的代码(使用 jclouds 库)-
Set<? extends NodeMetadata> nodes;
BlobStore blobStore = bscontext.getBlobStore();
Blob blob;
blob 必须在云存储中存储/检索。这些是在 blob 中实际存储一些数据的以下方法 -
blob.setPayload(argument)
Argument= byte/file/inputstream/string.
我想知道的是,我使用以上哪个(即字节或文件或输入流或字符串)?另外,如何将名为“nodes”的 Set 变量中存储的值转换为该格式,以便可以将其存储为 blob?
【问题讨论】: