Package com.azure.storage.blob.options
Class BlockBlobSimpleUploadOptions
java.lang.Object
com.azure.storage.blob.options.BlockBlobSimpleUploadOptions
Extended options that may be passed when uploading a Block Blob in a single request.
-
Constructor Summary
ConstructorsConstructorDescriptionBlockBlobSimpleUploadOptions
(com.azure.core.util.BinaryData data) Creates a new instance ofBlockBlobSimpleUploadOptions
.BlockBlobSimpleUploadOptions
(InputStream data, long length) Creates a new instance ofBlockBlobSimpleUploadOptions
.BlockBlobSimpleUploadOptions
(Flux<ByteBuffer> data, long length) Creates a new instance ofBlockBlobSimpleUploadOptions
. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Gets the MD5 hash of the content.com.azure.core.util.BinaryData
getData()
Gets the data to write to the blob.Gets the data to write to the blob.Gets the data to write to the blob.Gets theBlobHttpHeaders
.Gets theBlobImmutabilityPolicy
.long
Gets the exact length of the data.Gets the metadata to associate with the blob.Gets theBlobRequestConditions
.getTags()
Gets the tags to associate with the blob.getTier()
Gets theAccessTier
.Gets if a legal hold should be placed on the blob.setContentMd5
(byte[] contentMd5) Sets the MD5 hash of the content.setHeaders
(BlobHttpHeaders headers) Sets theBlobHttpHeaders
.setImmutabilityPolicy
(BlobImmutabilityPolicy immutabilityPolicy) Sets theBlobImmutabilityPolicy
.setLegalHold
(Boolean legalHold) Sets if a legal hold should be placed on the blob.setMetadata
(Map<String, String> metadata) Sets the metadata to associate with the blob.setRequestConditions
(BlobRequestConditions requestConditions) Sets theBlobRequestConditions
.Sets the tags to associate with the blob.setTier
(AccessTier tier) Sets theAccessTier
.
-
Constructor Details
-
BlockBlobSimpleUploadOptions
public BlockBlobSimpleUploadOptions(com.azure.core.util.BinaryData data) Creates a new instance ofBlockBlobSimpleUploadOptions
.- Parameters:
data
- The data to write to the block. Note that thisBinaryData
must have defined length and must be replayable if retries are enabled (the default), seeBinaryData.isReplayable()
.- Throws:
NullPointerException
- Ifdata
is null ordata
does not have defined length.
-
BlockBlobSimpleUploadOptions
Creates a new instance ofBlockBlobSimpleUploadOptions
.- Parameters:
data
- The data to write to the blob. Note that thisFlux
must be replayable if retries are enabled (the default). In other words, the Flux must produce the same data each time it is subscribed to.length
- The exact length of the data. It is important that this value match precisely the length of the data emitted by the data source.- Throws:
NullPointerException
- Ifdata
is null.IllegalArgumentException
- Iflength
is less than 0 or greater thanLong.MAX_VALUE
.
-
BlockBlobSimpleUploadOptions
Creates a new instance ofBlockBlobSimpleUploadOptions
.- Parameters:
data
- The data to write to the blob.length
- The exact length of the data. It is important that this value match precisely the length of the data emitted by the data source.- Throws:
NullPointerException
- Ifdata
is null.IllegalArgumentException
- Iflength
is less than 0 or greater thanLong.MAX_VALUE
.
-
-
Method Details
-
getDataFlux
Gets the data to write to the blob.- Returns:
- The data to write to the blob. Note that this
Flux
must be replayable if retries are enabled (the default). In other words, the Flux must produce the same data each time it is subscribed to.
-
getDataStream
Gets the data to write to the blob.- Returns:
- The data to write to the blob.
-
getData
public com.azure.core.util.BinaryData getData()Gets the data to write to the blob.- Returns:
- The data to write to the blob.
-
getLength
public long getLength()Gets the exact length of the data.- Returns:
- The exact length of the data. It is important that this value match precisely the length of the data emitted by the data source.
-
getHeaders
Gets theBlobHttpHeaders
.- Returns:
BlobHttpHeaders
-
setHeaders
Sets theBlobHttpHeaders
.- Parameters:
headers
-BlobHttpHeaders
- Returns:
- The updated options
-
getMetadata
Gets the metadata to associate with the blob.- Returns:
- The metadata to associate with the blob.
-
setMetadata
Sets the metadata to associate with the blob.- Parameters:
metadata
- The metadata to associate with the blob.- Returns:
- The updated options
-
getTags
Gets the tags to associate with the blob.- Returns:
- The tags to associate with the blob.
-
setTags
Sets the tags to associate with the blob.- Parameters:
tags
- The tags to associate with the blob.- Returns:
- The updated options.
-
getTier
Gets theAccessTier
.- Returns:
AccessTier
-
setTier
Sets theAccessTier
.- Parameters:
tier
-AccessTier
- Returns:
- The updated options.
-
getContentMd5
public byte[] getContentMd5()Gets the MD5 hash of the content.- Returns:
- An MD5 hash of the content. This hash is used to verify the integrity of the content during transport. When this header is specified, the storage service compares the hash of the content that has arrived with this header value. Note that this MD5 hash is not stored with the blob. If the two hashes do not match, the operation will fail.
-
setContentMd5
Sets the MD5 hash of the content.- Parameters:
contentMd5
- An MD5 hash of the block content. This hash is used to verify the integrity of the block during transport. When this header is specified, the storage service compares the hash of the content that has arrived with this header value. Note that this MD5 hash is not stored with the blob. If the two hashes do not match, the operation will fail.- Returns:
- The updated options
-
getRequestConditions
Gets theBlobRequestConditions
.- Returns:
BlobRequestConditions
-
setRequestConditions
Sets theBlobRequestConditions
.- Parameters:
requestConditions
-BlobRequestConditions
- Returns:
- The updated options.
-
getImmutabilityPolicy
Gets theBlobImmutabilityPolicy
.- Returns:
BlobImmutabilityPolicy
-
setImmutabilityPolicy
public BlockBlobSimpleUploadOptions setImmutabilityPolicy(BlobImmutabilityPolicy immutabilityPolicy) Sets theBlobImmutabilityPolicy
.Note that this parameter is only applicable to a blob within a container that has immutable storage with versioning enabled.
- Parameters:
immutabilityPolicy
-BlobImmutabilityPolicy
- Returns:
- The updated options.
-
isLegalHold
Gets if a legal hold should be placed on the blob.- Returns:
- If a legal hold should be placed on the blob.
-
setLegalHold
Sets if a legal hold should be placed on the blob.Note that this parameter is only applicable to a blob within a container that has immutable storage with versioning enabled.
- Parameters:
legalHold
- Indicates if a legal hold should be placed on the blob.- Returns:
- The updated options.
-