BlobRequestOptions Class

  • java.lang.Object

public class BlobRequestOptions extends RequestOptions

Represents a set of options that may be specified on a request.

Constructor Summary

Constructor Description
BlobRequestOptions()

Creates an instance of the class.

BlobRequestOptions(final BlobRequestOptions other)

Creates an instance of the class by copying values from another instance.

Method Summary

Modifier and Type Method and Description
void applyDefaults(final BlobRequestOptions modifiedOptions, final BlobType blobtype)

Applies defaults to the options passed in.

void assertNoEncryptionPolicyOrStrictMode()

Assert that if validation is on, an encryption policy is not specified.

void assertPolicyIfRequired()

Assert that if strict mode is on, an encryption policy is specified.

Boolean getAbsorbConditionalErrorsOnRetry()

Indicates whether a conditional failure should be absorbed on a retry attempt for the request. For more information about absorb conditinal errors on retry defaults, see setAbsorbConditionalErrorsOnRetry(final Boolean absorbConditionalErrorsOnRetry).

boolean getCommitWriteOnInputStreamException()

A that defines the behavior for handling exceptions when reading from the and using . If the data that has been read from the stream up to the point of the exception will be flushed and a new blob will be committed with that data. Otherwise, the upload will be aborted and no data will be committed.

For more information about defaults, see setCommitWriteOnInputStreamException(boolean commitWriteOnInputStreamException).

Integer getConcurrentRequestCount()

Gets the concurrent number of simultaneous requests per operation. For more information about concurrent request count defaults, see setConcurrentRequestCount(final Integer concurrentRequestCount).

BlobCustomerProvidedKey getCustomerProvidedKey()

Gets the customer-provided key to use for this request.

Boolean getDisableContentMD5Validation()

Gets whether download and BlobInputStream methods should ignore the blob's ContentMD5 header. For more information about disabling content MD5 validation defaults, see setDisableContentMD5Validation(final Boolean disableContentMD5Validation)

BlobEncryptionPolicy getEncryptionPolicy()

Gets the encryption policy to use for this request. For more information about the encryption policy defaults, see setEncryptionPolicy(BlobEncryptionPolicy encryptionPolicy).

Integer getSingleBlobPutThresholdInBytes()

Gets the threshold size used for writing a single blob. For more information about the threshold size defaults, see setSingleBlobPutThresholdInBytes(final Integer singleBlobPutThresholdInBytes).

boolean getSkipEtagLocking()

WARNING: etag locking is automatically used in blob downloads to ensure the blob does not change mid-download. Skip this validation at your own risk.

Gets whether etag locking and validation on blob downloads should be skipped.

Boolean getStoreBlobContentMD5()

Gets whether the blob's ContentMD5 header should be set on uploads. This field is not supported for page blobs. For more information about storing blob content MD5 defaults, see setStoreBlobContentMD5(final Boolean storeBlobContentMD5)

Boolean getUseTransactionalContentMD5()

Gets whether a range PUT or GET operation will use the Content-MD5 header to enforce transactional security. All partial blob uploads or downloads will be restricted to 4 MB. For more information about transactional content MD5 defaults, see setUseTransactionalContentMD5(final Boolean useTransactionalContentMD5).

boolean getValidateEncryptionPolicy()

Gets the customer-provided key to use on the source for a copy request.

final BlobRequestOptions populateAndApplyDefaults(final BlobRequestOptions options, final BlobType blobType, final CloudBlobClient client)

Uses the concurrent request count from the specified client if , sets a default value for everything else, and sets defaults as defined in the parent class.

final BlobRequestOptions populateAndApplyDefaults(final BlobRequestOptions options, final BlobType blobType, final CloudBlobClient client, final boolean setStartTime)

Uses the concurrent request count from the specified client if , sets a default value for everything else, and sets defaults as defined in the parent class.

void setAbsorbConditionalErrorsOnRetry(final Boolean absorbConditionalErrorsOnRetry)

Sets whether a conditional failure should be absorbed on a retry attempt for the request. This option is only used by CloudAppendBlob in upload and openWrite methods. By default, it is set to . Set this to only for single writer scenario.

You can change the absorbConditionalErrorsOnRetry value on this request by setting this property. You can also change the value on the getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that absorbConditionalErrorsOnRetry value.

void setCommitWriteOnInputStreamException(boolean commitWriteOnInputStreamException)

A that defines the behavior for handling exceptions when reading from the and using . If the data that has been read from the stream up to the point of the exception will be flushed and a new blob will be committed with that data. Otherwise, the upload will be aborted and no data will be committed.

The default value is .

void setConcurrentRequestCount(final Integer concurrentRequestCount)

Sets the concurrent number of simultaneous requests per operation.

The default concurrent request count is set in the client and is by default 1, indicating no concurrency. You can change the concurrent request count on this request by setting this property. You can also change the value on the getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that concurrent request count.

void setCustomerProvidedKey(BlobCustomerProvidedKey key)

Sets the BlobCustomerProvidedKey object to use for this request. Customer-provided key encryption is supported for most upload, download, and copy requests to blob storage, as well as fetching of properties and metadata.

void setDisableContentMD5Validation(final Boolean disableContentMD5Validation)

Sets whether download and BlobInputStream methods should ignore the blob's ContentMD5 header.

The default disableContentMD5Validation value is set in the client and is by default . You can change the disableContentMD5Validation value on this request by setting this property. You can also change the value on the getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that disableContentMD5Validation value.

void setEncryptionPolicy(BlobEncryptionPolicy encryptionPolicy)

Sets the BlobEncryptionPolicy object to use for this request.

The default BlobEncryptionPolicy is set in the client and is by default null, indicating no encryption. You can change the BlobEncryptionPolicy on this request by setting this property. You can also change the value on the getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that BlobEncryptionPolicy.

void setSingleBlobPutThresholdInBytes(final Integer singleBlobPutThresholdInBytes)

Sets the threshold size used for writing a single blob to use.

The default threshold size is set in the client and is by default 32MB. You can change the threshold size on this request by setting this property. You can also change the value on the getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that threshold size.

void setSkipEtagLocking(boolean skipEtagLocking)

WARNING: etag locking is automatically used in blob downloads to ensure the blob does not change mid-download. Skip this validation at your own risk.

Sets whether etag locking and validation on blob downloads should be skipped.

void setStoreBlobContentMD5(final Boolean storeBlobContentMD5)

Sets whether the blob's ContentMD5 header should be set on uploads. This field is not supported for page blobs.

The default storeBlobContentMD5 value is set in the client and is by default for block blobs. You can change the storeBlobContentMD5 value on this request by setting this property. You can also change the value on the getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that storeBlobContentMD5 value.

void setUseTransactionalContentMD5(final Boolean useTransactionalContentMD5)

Sets whether a range PUT or GET operation will use the Content-MD5 header to enforce transactional security. All partial blob uploads or downloads will be restricted to 4 MB.

The default useTransactionalContentMD5 value is set in the client and is by default . You can change the useTransactionalContentMD5 value on this request by setting this property. You can also change the value on the getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that useTransactionalContentMD5 value.

void setValidateEncryptionPolicy(boolean validateEncryptionPolicy)

Sets the BlobCustomerProvidedKey object to use for a source blob. Customer-provided key encryption is supported for most upload, download, and copy requests to blob storage, as well as fetching of properties and metadata.

Inherited Members

Constructor Details

BlobRequestOptions

public BlobRequestOptions()

Creates an instance of the class.

BlobRequestOptions

public BlobRequestOptions(final BlobRequestOptions other)

Creates an instance of the class by copying values from another instance.

Parameters:

other - A BlobRequestOptions object which represents the blob request options to copy.

Method Details

applyDefaults

protected static void applyDefaults(final BlobRequestOptions modifiedOptions, final BlobType blobtype)

Applies defaults to the options passed in.

Parameters:

modifiedOptions - The options to apply defaults to.
blobtype

assertNoEncryptionPolicyOrStrictMode

protected void assertNoEncryptionPolicyOrStrictMode()

Assert that if validation is on, an encryption policy is not specified.

assertPolicyIfRequired

protected void assertPolicyIfRequired()

Assert that if strict mode is on, an encryption policy is specified.

getAbsorbConditionalErrorsOnRetry

public Boolean getAbsorbConditionalErrorsOnRetry()

Indicates whether a conditional failure should be absorbed on a retry attempt for the request. For more information about absorb conditinal errors on retry defaults, see setAbsorbConditionalErrorsOnRetry(final Boolean absorbConditionalErrorsOnRetry).

Returns:

the absorbConditionalErrorsOnRetry

getCommitWriteOnInputStreamException

public boolean getCommitWriteOnInputStreamException()

A that defines the behavior for handling exceptions when reading from the and using . If the data that has been read from the stream up to the point of the exception will be flushed and a new blob will be committed with that data. Otherwise, the upload will be aborted and no data will be committed.

For more information about defaults, see setCommitWriteOnInputStreamException(boolean commitWriteOnInputStreamException).

Returns:

true if data will be committed upon an exception; otherwise, false.

getConcurrentRequestCount

public Integer getConcurrentRequestCount()

Gets the concurrent number of simultaneous requests per operation. For more information about concurrent request count defaults, see setConcurrentRequestCount(final Integer concurrentRequestCount).

Returns:

the concurrentRequestCount

getCustomerProvidedKey

public BlobCustomerProvidedKey getCustomerProvidedKey()

Gets the customer-provided key to use for this request.

Returns:

A BlobCustomerProvidedKey object that represents the current customer-provided key.

getDisableContentMD5Validation

public Boolean getDisableContentMD5Validation()

Gets whether download and BlobInputStream methods should ignore the blob's ContentMD5 header. For more information about disabling content MD5 validation defaults, see setDisableContentMD5Validation(final Boolean disableContentMD5Validation)

Returns:

the disableContentMD5Validation

getEncryptionPolicy

public BlobEncryptionPolicy getEncryptionPolicy()

Gets the encryption policy to use for this request. For more information about the encryption policy defaults, see setEncryptionPolicy(BlobEncryptionPolicy encryptionPolicy).

Returns:

An BlobEncryptionPolicy object that represents the current encryption policy.

getSingleBlobPutThresholdInBytes

public Integer getSingleBlobPutThresholdInBytes()

Gets the threshold size used for writing a single blob. For more information about the threshold size defaults, see setSingleBlobPutThresholdInBytes(final Integer singleBlobPutThresholdInBytes).

Returns:

The maximum size, in bytes, of a blob that may be uploaded as a single blob, ranging from 1 to 64 MB inclusive. If a blob size is above the threshold, it will be uploaded as blocks.

getSkipEtagLocking

public boolean getSkipEtagLocking()

WARNING: etag locking is automatically used in blob downloads to ensure the blob does not change mid-download. Skip this validation at your own risk.

Gets whether etag locking and validation on blob downloads should be skipped.

Returns:

true if skipping is enabled; otherwise, false.

getStoreBlobContentMD5

public Boolean getStoreBlobContentMD5()

Gets whether the blob's ContentMD5 header should be set on uploads. This field is not supported for page blobs. For more information about storing blob content MD5 defaults, see setStoreBlobContentMD5(final Boolean storeBlobContentMD5)

Returns:

the storeBlobContentMD5

getUseTransactionalContentMD5

public Boolean getUseTransactionalContentMD5()

Gets whether a range PUT or GET operation will use the Content-MD5 header to enforce transactional security. All partial blob uploads or downloads will be restricted to 4 MB. For more information about transactional content MD5 defaults, see setUseTransactionalContentMD5(final Boolean useTransactionalContentMD5).

Returns:

the useTransactionalContentMD5

getValidateEncryptionPolicy

protected boolean getValidateEncryptionPolicy()

Gets the customer-provided key to use on the source for a copy request.

Returns:

A BlobCustomerProvidedKey object that represents the source's customer-provided key. Gets a value to indicating whether the presence of the encryption policy should validated.

populateAndApplyDefaults

protected static final BlobRequestOptions populateAndApplyDefaults(final BlobRequestOptions options, final BlobType blobType, final CloudBlobClient client)

Uses the concurrent request count from the specified client if , sets a default value for everything else, and sets defaults as defined in the parent class.

Parameters:

options - The input options to copy from when applying defaults
blobType - BlobType of the current operation
client - A CloudBlobClient object that represents the service client used to set the default timeout interval and retry policy, if they are null. Additionally, the default value of concurrentRequestCount is 1.

populateAndApplyDefaults

protected static final BlobRequestOptions populateAndApplyDefaults(final BlobRequestOptions options, final BlobType blobType, final CloudBlobClient client, final boolean setStartTime)

Uses the concurrent request count from the specified client if , sets a default value for everything else, and sets defaults as defined in the parent class.

Parameters:

options - The input options to copy from when applying defaults
blobType - BlobType of the current operation
client - A CloudBlobClient object that represents the service client used to set the default timeout interval and retry policy, if they are null. Additionally, the default value of concurrentRequestCount is 1.
setStartTime - whether to initialize the startTimeInMs field, or not

setAbsorbConditionalErrorsOnRetry

public void setAbsorbConditionalErrorsOnRetry(final Boolean absorbConditionalErrorsOnRetry)

Sets whether a conditional failure should be absorbed on a retry attempt for the request. This option is only used by CloudAppendBlob in upload and openWrite methods. By default, it is set to . Set this to only for single writer scenario.

You can change the absorbConditionalErrorsOnRetry value on this request by setting this property. You can also change the value on the getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that absorbConditionalErrorsOnRetry value.

Parameters:

absorbConditionalErrorsOnRetry - the absorbConditionalErrorsOnRetry to set

setCommitWriteOnInputStreamException

public void setCommitWriteOnInputStreamException(boolean commitWriteOnInputStreamException)

A that defines the behavior for handling exceptions when reading from the and using . If the data that has been read from the stream up to the point of the exception will be flushed and a new blob will be committed with that data. Otherwise, the upload will be aborted and no data will be committed.

The default value is .

Parameters:

commitWriteOnInputStreamException - Use true if data will be committed upon an exception; otherwise, false.

setConcurrentRequestCount

public void setConcurrentRequestCount(final Integer concurrentRequestCount)

Sets the concurrent number of simultaneous requests per operation.

The default concurrent request count is set in the client and is by default 1, indicating no concurrency. You can change the concurrent request count on this request by setting this property. You can also change the value on the getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that concurrent request count.

Parameters:

concurrentRequestCount - the concurrentRequestCount to set

setCustomerProvidedKey

public void setCustomerProvidedKey(BlobCustomerProvidedKey key)

Sets the BlobCustomerProvidedKey object to use for this request. Customer-provided key encryption is supported for most upload, download, and copy requests to blob storage, as well as fetching of properties and metadata.

Parameters:

key - the BlobCustomerProvidedKey object to use when making service requests.

setDisableContentMD5Validation

public void setDisableContentMD5Validation(final Boolean disableContentMD5Validation)

Sets whether download and BlobInputStream methods should ignore the blob's ContentMD5 header.

The default disableContentMD5Validation value is set in the client and is by default . You can change the disableContentMD5Validation value on this request by setting this property. You can also change the value on the getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that disableContentMD5Validation value.

Parameters:

disableContentMD5Validation - the disableContentMD5Validation to set

setEncryptionPolicy

public void setEncryptionPolicy(BlobEncryptionPolicy encryptionPolicy)

Sets the BlobEncryptionPolicy object to use for this request.

The default BlobEncryptionPolicy is set in the client and is by default null, indicating no encryption. You can change the BlobEncryptionPolicy on this request by setting this property. You can also change the value on the getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that BlobEncryptionPolicy.

Parameters:

encryptionPolicy - the BlobEncryptionPolicy object to use when making service requests.

setSingleBlobPutThresholdInBytes

public void setSingleBlobPutThresholdInBytes(final Integer singleBlobPutThresholdInBytes)

Sets the threshold size used for writing a single blob to use.

The default threshold size is set in the client and is by default 32MB. You can change the threshold size on this request by setting this property. You can also change the value on the getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that threshold size.

Parameters:

singleBlobPutThresholdInBytes - The maximum size, in bytes, of a blob that may be uploaded as a single blob, ranging from 1 MB to 64 MB inclusive. If a blob size is above the threshold, it will be uploaded as blocks.

Throws:

IllegalArgumentException - If minimumReadSize is less than 1 MB or greater than 64 MB.

setSkipEtagLocking

public void setSkipEtagLocking(boolean skipEtagLocking)

WARNING: etag locking is automatically used in blob downloads to ensure the blob does not change mid-download. Skip this validation at your own risk.

Sets whether etag locking and validation on blob downloads should be skipped.

Parameters:

skipEtagLocking - Use true to skip etag locking and validation; otherwise, false.

setStoreBlobContentMD5

public void setStoreBlobContentMD5(final Boolean storeBlobContentMD5)

Sets whether the blob's ContentMD5 header should be set on uploads. This field is not supported for page blobs.

The default storeBlobContentMD5 value is set in the client and is by default for block blobs. You can change the storeBlobContentMD5 value on this request by setting this property. You can also change the value on the getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that storeBlobContentMD5 value.

Parameters:

storeBlobContentMD5 - the storeBlobContentMD5 to set

setUseTransactionalContentMD5

public void setUseTransactionalContentMD5(final Boolean useTransactionalContentMD5)

Sets whether a range PUT or GET operation will use the Content-MD5 header to enforce transactional security. All partial blob uploads or downloads will be restricted to 4 MB.

The default useTransactionalContentMD5 value is set in the client and is by default . You can change the useTransactionalContentMD5 value on this request by setting this property. You can also change the value on the getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that useTransactionalContentMD5 value.

Parameters:

useTransactionalContentMD5 - the useTransactionalContentMD5 to set

setValidateEncryptionPolicy

protected void setValidateEncryptionPolicy(boolean validateEncryptionPolicy)

Sets the BlobCustomerProvidedKey object to use for a source blob. Customer-provided key encryption is supported for most upload, download, and copy requests to blob storage, as well as fetching of properties and metadata.

Parameters:

validateEncryptionPolicy - Use true to require validation; otherwise, false.

Applies to