BlobRequestOptions Class
- java.
lang. Object - RequestOptions
- com.
microsoft. azure. storage. blob. BlobRequestOptions
- com.
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). |
Blob |
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) |
Blob |
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 Blob |
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 Blob |
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:
Method Details
applyDefaults
protected static void applyDefaults(final BlobRequestOptions modifiedOptions, final BlobType blobtype)
Applies defaults to the options passed in.
Parameters:
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:
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:
getCustomerProvidedKey
public BlobCustomerProvidedKey getCustomerProvidedKey()
Gets the customer-provided key to use for this request.
Returns:
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:
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:
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:
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:
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:
getValidateEncryptionPolicy
protected boolean getValidateEncryptionPolicy()
Gets the customer-provided key to use on the source for a copy request.
Returns:
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:
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:
null
. Additionally, the default value of concurrentRequestCount is 1
.
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:
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:
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:
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:
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:
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:
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:
Throws:
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:
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:
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:
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:
true
to require validation; otherwise, false
.
Applies to
Azure SDK for Java