> +   @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()));

Do you need to close the `InputStream`?  Shouldn't you also calculate the hash 
while copying instead of re-reading from the  database below?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/176/files#r32473757

Reply via email to