@Override public String putBlob(String containerName, Blob blob, PutOptions options) { checkNotNull(containerName, "containerName must be set"); checkNotNull(blob, "blob must be set"); String blobKey = blob.getMetadata().getName(); logger.debug("Put blob with key [%s] to container [%s]", blobKey, containerName); if (!storageStrategy.containerExists(containerName)) { throw cnfe(containerName); } try { String eTag = storageStrategy.putBlob(containerName, blob); setBlobAccess(containerName, blobKey, options.getBlobAccess()); return eTag; } catch (IOException e) { String message = e.getMessage(); if (message != null && message.startsWith("MD5 hash code mismatch")) { HttpResponseException exception = returnResponseException(400); exception.initCause(e); throw exception; } logger.error(e, "An error occurred storing the new blob with name [%s] to container [%s].", blobKey, containerName); throw propagate(e); } }
@Override public String putBlob(String containerName, Blob blob, PutOptions options) { checkNotNull(containerName, "containerName must be set"); checkNotNull(blob, "blob must be set"); String blobKey = blob.getMetadata().getName(); logger.debug("Put blob with key [%s] to container [%s]", blobKey, containerName); if (!storageStrategy.containerExists(containerName)) { throw cnfe(containerName); } try { String eTag = storageStrategy.putBlob(containerName, blob); setBlobAccess(containerName, blobKey, options.getBlobAccess()); return eTag; } catch (IOException e) { String message = e.getMessage(); if (message != null && message.startsWith("MD5 hash code mismatch")) { HttpResponseException exception = returnResponseException(400); exception.initCause(e); throw exception; } logger.error(e, "An error occurred storing the new blob with name [%s] to container [%s].", blobKey, containerName); throw propagate(e); } }
@Override public String putBlob(String containerName, Blob blob, PutOptions options) { checkNotNull(containerName, "containerName must be set"); checkNotNull(blob, "blob must be set"); String blobKey = blob.getMetadata().getName(); logger.debug("Put blob with key [%s] to container [%s]", blobKey, containerName); if (!storageStrategy.containerExists(containerName)) { throw cnfe(containerName); } try { String eTag = storageStrategy.putBlob(containerName, blob); setBlobAccess(containerName, blobKey, options.getBlobAccess()); return eTag; } catch (IOException e) { String message = e.getMessage(); if (message != null && message.startsWith("MD5 hash code mismatch")) { HttpResponseException exception = returnResponseException(400); exception.initCause(e); throw exception; } logger.error(e, "An error occurred storing the new blob with name [%s] to container [%s].", blobKey, containerName); throw propagate(e); } }
@Override public String putBlob(String containerName, Blob blob, PutOptions options) { checkNotNull(containerName, "containerName must be set"); checkNotNull(blob, "blob must be set"); String blobKey = blob.getMetadata().getName(); logger.debug("Put blob with key [%s] to container [%s]", blobKey, containerName); if (!storageStrategy.containerExists(containerName)) { throw cnfe(containerName); } try { String eTag = storageStrategy.putBlob(containerName, blob); setBlobAccess(containerName, blobKey, options.getBlobAccess()); return eTag; } catch (IOException e) { String message = e.getMessage(); if (message != null && message.startsWith("MD5 hash code mismatch")) { HttpResponseException exception = returnResponseException(400); exception.initCause(e); throw exception; } logger.error(e, "An error occurred storing the new blob with name [%s] to container [%s].", blobKey, containerName); throw propagate(e); } }