if (this.options.getStoreBlobContentMD5()) { this.md5Digest.update(data, offset, nextWrite);
if (this.options.getStoreBlobContentMD5()) { this.md5Digest.update(data, offset, nextWrite);
/** * Commits the blob, for block blob this uploads the block list. * * @throws StorageException * An exception representing any error which occurred during the operation. */ @DoesServiceRequest private synchronized void commit() throws StorageException { if (this.options.getStoreBlobContentMD5()) { this.parentBlobRef.getProperties().setContentMD5(Base64.encode(this.md5Digest.digest())); } if (this.streamType == BlobType.BLOCK_BLOB) { // wait for all blocks to finish final CloudBlockBlob blobRef = (CloudBlockBlob) this.parentBlobRef; blobRef.commitBlockList(this.blockList, this.accessCondition, this.options, this.opContext); } else if (this.options.getStoreBlobContentMD5()) { this.parentBlobRef.uploadProperties(this.accessCondition, this.options, this.opContext); } }
/** * Commits the blob, for block blob this uploads the block list. * * @throws StorageException * An exception representing any error which occurred during the operation. */ @DoesServiceRequest private synchronized void commit() throws StorageException { if (this.options.getStoreBlobContentMD5()) { this.parentBlobRef.getProperties().setContentMD5(Base64.encode(this.md5Digest.digest())); } if (this.streamType == BlobType.BLOCK_BLOB) { // wait for all blocks to finish final CloudBlockBlob blobRef = (CloudBlockBlob) this.parentBlobRef; blobRef.commitBlockList(this.blockList, this.accessCondition, this.options, this.opContext); } else if (this.options.getStoreBlobContentMD5()) { this.parentBlobRef.uploadProperties(this.accessCondition, this.options, this.opContext); } }
this.options.getConcurrentRequestCount() == null ? 1 : this.options.getConcurrentRequestCount() * 2)); if (this.options.getStoreBlobContentMD5()) { try { this.md5Digest = MessageDigest.getInstance("MD5");
this.options.getConcurrentRequestCount() == null ? 1 : this.options.getConcurrentRequestCount() * 2)); if (this.options.getStoreBlobContentMD5()) { try { this.md5Digest = MessageDigest.getInstance("MD5");
if (options.getStoreBlobContentMD5()) { throw new IllegalArgumentException(SR.BLOB_MD5_NOT_SUPPORTED_FOR_PAGE_BLOBS);
if (options.getStoreBlobContentMD5()) { throw new IllegalArgumentException(SR.BLOB_MD5_NOT_SUPPORTED_FOR_PAGE_BLOBS);
&& (length < 0 || (options.getStoreBlobContentMD5() && length <= options .getSingleBlobPutThresholdInBytes()))) { true /* rewindSourceStream */, options.getStoreBlobContentMD5()); if (descriptor.getMd5() != null && options.getStoreBlobContentMD5()) { this.properties.setContentMD5(descriptor.getMd5());
false /* setStartTime */); if (options.getStoreBlobContentMD5()) { throw new IllegalArgumentException(SR.BLOB_MD5_NOT_SUPPORTED_FOR_PAGE_BLOBS);
if (!skipPutBlob && (descriptor.getLength() < 0 || options.getStoreBlobContentMD5())) { true /* rewindSourceStream */, options.getStoreBlobContentMD5()); if (descriptor.getMd5() != null && options.getStoreBlobContentMD5()) { this.properties.setContentMD5(descriptor.getMd5()); || !inputDataStream.markSupported() || this.streamWriteSizeInBytes < Constants.MIN_LARGE_BLOCK_SIZE || options.getStoreBlobContentMD5() || descriptor.getLength() == -1;
/** * Populates any null fields in the first requestOptions object with values from the second requestOptions object. */ private static void populateRequestOptions(BlobRequestOptions modifiedOptions, final BlobRequestOptions clientOptions, final boolean setStartTime) { RequestOptions.populateRequestOptions(modifiedOptions, clientOptions, setStartTime); if (modifiedOptions.getAbsorbConditionalErrorsOnRetry() == null) { modifiedOptions.setAbsorbConditionalErrorsOnRetry(clientOptions.getAbsorbConditionalErrorsOnRetry()); } if (modifiedOptions.getConcurrentRequestCount() == null) { modifiedOptions.setConcurrentRequestCount(clientOptions.getConcurrentRequestCount()); } if (modifiedOptions.getSingleBlobPutThresholdInBytes() == null) { modifiedOptions.setSingleBlobPutThresholdInBytes(clientOptions.getSingleBlobPutThresholdInBytes()); } if (modifiedOptions.getUseTransactionalContentMD5() == null) { modifiedOptions.setUseTransactionalContentMD5(clientOptions.getUseTransactionalContentMD5()); } if (modifiedOptions.getStoreBlobContentMD5() == null) { modifiedOptions.setStoreBlobContentMD5(clientOptions.getStoreBlobContentMD5()); } if (modifiedOptions.getDisableContentMD5Validation() == null) { modifiedOptions.setDisableContentMD5Validation(clientOptions.getDisableContentMD5Validation()); } }
/** * Creates an instance of the <code>BlobRequestOptions</code> class by copying values from another * <code>BlobRequestOptions</code> instance. * * @param other * A {@link BlobRequestOptions} object which represents the blob request options to copy. */ public BlobRequestOptions(final BlobRequestOptions other) { super(other); if (other != null) { this.setAbsorbConditionalErrorsOnRetry(other.getAbsorbConditionalErrorsOnRetry()); this.setConcurrentRequestCount(other.getConcurrentRequestCount()); this.setUseTransactionalContentMD5(other.getUseTransactionalContentMD5()); this.setStoreBlobContentMD5(other.getStoreBlobContentMD5()); this.setDisableContentMD5Validation(other.getDisableContentMD5Validation()); this.setSingleBlobPutThresholdInBytes(other.getSingleBlobPutThresholdInBytes()); } }
if (modifiedOptions.getStoreBlobContentMD5() == null) { modifiedOptions.setStoreBlobContentMD5(clientOptions.getStoreBlobContentMD5());
if (options.getStoreBlobContentMD5()) { throw new IllegalArgumentException(SR.BLOB_MD5_NOT_SUPPORTED_FOR_PAGE_BLOBS);
this.createOrReplace(accessCondition, modifiedOptions, opContext); } else { if (modifiedOptions.getStoreBlobContentMD5()) { throw new IllegalArgumentException(SR.APPEND_BLOB_MD5_NOT_POSSIBLE);
/** * Creates an instance of the <code>BlobRequestOptions</code> class by copying values from another * <code>BlobRequestOptions</code> instance. * * @param other * A {@link BlobRequestOptions} object which represents the blob request options to copy. */ public BlobRequestOptions(final BlobRequestOptions other) { super(other); if (other != null) { this.setAbsorbConditionalErrorsOnRetry(other.getAbsorbConditionalErrorsOnRetry()); this.setConcurrentRequestCount(other.getConcurrentRequestCount()); this.setUseTransactionalContentMD5(other.getUseTransactionalContentMD5()); this.setStoreBlobContentMD5(other.getStoreBlobContentMD5()); this.setDisableContentMD5Validation(other.getDisableContentMD5Validation()); this.setSingleBlobPutThresholdInBytes(other.getSingleBlobPutThresholdInBytes()); this.setEncryptionPolicy(other.getEncryptionPolicy()); this.setValidateEncryptionPolicy(other.getValidateEncryptionPolicy()); } }
this.createOrReplace(accessCondition, options, opContext); } else { if (options.getStoreBlobContentMD5()) { throw new IllegalArgumentException(SR.APPEND_BLOB_MD5_NOT_POSSIBLE);
if (modifiedOptions.getStoreBlobContentMD5() == null) { if (blobtype != BlobType.UNSPECIFIED) { modifiedOptions.setStoreBlobContentMD5(blobtype == BlobType.BLOCK_BLOB);
if (modifiedOptions.getStoreBlobContentMD5() == null) { if (blobtype != BlobType.UNSPECIFIED) { modifiedOptions.setStoreBlobContentMD5(blobtype == BlobType.BLOCK_BLOB);