> + @Transactional
> + public boolean blobExists(String containerName, String key) {
> + return findBlobById(containerName, key) != null;
> + }
> +
> + @Transactional(rollbackOn = IOException.class)
> + public BlobEntity createOrModifyBlob(String containerName, Blob blob,
> BlobAccess blobAccess) throws IOException {
> + String key = blob.getMetadata().getName();
> + Date creationDate = null;
> + BlobEntity oldBlobEntity = findBlobById(containerName, key);
> + if (oldBlobEntity != null) {
> + creationDate = oldBlobEntity.getCreationDate();
> + deleteBlob(containerName, key);
> + }
> + BlobEntity blobEntity = blobToBlobEntity.apply(blob);
> +
> blobEntity.getPayload().setChunks(storeData(blob.getPayload().openStream()));
The InputStream is closed in the storeData method :)
I think we need to check the integrity after the data is copied to the
database. I think we need to either set things up in the database to make it
return the hash of the copied data, or re-read the data from it and calculate
it. Any other ideas?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/176/files#r32676447