* @param container the blob store container.
* @param name the blob store name.
* @param data the blob store data.
*/
public void createBlob(String container, String name, Object data) {
Blob blob;
if (blobStore != null) {
if (!blobStore.containerExists(container)) {
blobStore.createContainerInLocation(null, container);
}
if (blobStore.blobExists(container, name)) {
blob = blobStore.getBlob(container, name);
} else {
blob = blobStore.blobBuilder(name).build();
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = null;
try {
oos = new ObjectOutputStream(baos);
oos.writeObject(data);
blob.setPayload(baos.toByteArray());
blobStore.putBlob(container, blob);
} catch (IOException e) {
LOGGER.error("CELLAR CLOUD: failed to write blob", e);
} finally {
if (oos != null) {