AZSCloudAppendBlob Class Reference

Inherits from AZSCloudBlob : NSObject
Declared in AZSCloudAppendBlob.h
AZSCloudAppendBlob.m

– initWithUrl:error:

Initializes a newly allocated AZSCloudAppendBlob object

- (instancetype)initWithUrl:(NSURL *)blobAbsoluteUrl error:(NSError **)error

Parameters

blobAbsoluteUrl

The absolute URL to the blob.

Return Value

The newly allocated instance.

Discussion

Initializes a newly allocated AZSCloudAppendBlob object

Declared In

AZSCloudAppendBlob.h

– initWithUrl:credentials:snapshotTime:error:

Initializes a newly allocated AZSCloudAppendBlob object

- (instancetype)initWithUrl:(NSURL *)blobAbsoluteUrl credentials:(AZSNullable AZSStorageCredentials *)credentials snapshotTime:(AZSNullable NSString *)snapshotTime error:(NSError **)error

Parameters

blobAbsoluteUrl

The absolute URL to the blob.

credentials

The AZSStorageCredentials used to authenticate to the blob

snapshotTime

The timestamp of the intended snapshot. If nil, this AZSCloudAppendBlob object refers to the actual blob, not a snapshot.

Return Value

The newly allocated instance.

Discussion

Initializes a newly allocated AZSCloudAppendBlob object

Declared In

AZSCloudAppendBlob.h

– initWithStorageUri:error:

Initializes a newly allocated AZSCloudAppendBlob object

- (instancetype)initWithStorageUri:(AZSStorageUri *)blobAbsoluteUri error:(NSError **)error

Parameters

blobAbsoluteUri

An AZSStorageUri representing the absolute URL to the blob.

Return Value

The newly allocated instance.

Discussion

Initializes a newly allocated AZSCloudAppendBlob object

Declared In

AZSCloudAppendBlob.h

– initWithStorageUri:credentials:snapshotTime:error:

Initializes a newly allocated AZSCloudAppendBlob object

- (instancetype)initWithStorageUri:(AZSStorageUri *)blobAbsoluteUri credentials:(AZSNullable AZSStorageCredentials *)credentials snapshotTime:(AZSNullable NSString *)snapshotTime error:(NSError **)error

Parameters

blobAbsoluteUri

An AZSStorageUri representing the absolute URL to the blob.

credentials

The AZSStorageCredentials used to authenticate to the blob

snapshotTime

The timestamp of the intended snapshot. If nil, this AZSCloudAppendBlob object refers to the actual blob, not a snapshot.

Return Value

The newly allocated instance.

Discussion

Initializes a newly allocated AZSCloudAppendBlob object

Declared In

AZSCloudAppendBlob.h

– initWithContainer:name:

Initializes a newly allocated AZSCloudAppendBlob object

- (instancetype)initWithContainer:(AZSCloudBlobContainer *)blobContainer name:(NSString *)blobName

Parameters

blobContainer

The AZSCloudBlobContainer in which the blob exists or should be created.

blobName

The name of the blob.

Return Value

The newly allocated instance.

Discussion

Initializes a newly allocated AZSCloudAppendBlob object

Declared In

AZSCloudAppendBlob.h

– initWithContainer:name:snapshotTime:

Initializes a newly allocated AZSCloudAppendBlob object

- (instancetype)initWithContainer:(AZSCloudBlobContainer *)blobContainer name:(NSString *)blobName snapshotTime:(AZSNullable NSString *)snapshotTime

Parameters

blobContainer

The AZSCloudBlobContainer in which the blob exists or should be created.

blobName

The name of the blob.

snapshotTime

The timestamp of the intended snapshot. If nil, this AZSCloudAppendBlob object refers to the actual blob, not a snapshot.

Return Value

The newly allocated instance.

Discussion

Initializes a newly allocated AZSCloudAppendBlob object

Declared In

AZSCloudAppendBlob.h

– createWithCompletionHandler:

Creates the append blob on the service.

- (void)createWithCompletionHandler:(void ( ^ ) ( NSError *__AZSNullable ))completionHandler

Parameters

completionHandler

The block of code to execute when the delete call completes. | Parameter name | Description | |—————-|————-| |NSError * | Nil if the operation succeeded without error, error with details about the failure otherwise.|

Discussion

Creates the append blob on the service.

Unlike block blobs, append blobs must be explicitly created on the service before data can be written. This method does the creation.

Declared In

AZSCloudAppendBlob.h

– createWithAccessCondition:requestOptions:operationContext:completionHandler:

Creates the append blob on the service.

- (void)createWithAccessCondition:(AZSNullable AZSAccessCondition *)accessCondition requestOptions:(AZSNullable AZSBlobRequestOptions *)requestOptions operationContext:(AZSNullable AZSOperationContext *)operationContext completionHandler:(void ( ^ ) ( NSError *__AZSNullable ))completionHandler

Parameters

accessCondition

The access condition for the request.

requestOptions

The options to use for the request.

operationContext

The operation context to use for the call.

completionHandler

The block of code to execute when the delete call completes. | Parameter name | Description | |—————-|————-| |NSError * | Nil if the operation succeeded without error, error with details about the failure otherwise.|

Discussion

Creates the append blob on the service.

Unlike block blobs, append blobs must be explicitly created on the service before data can be written. This method does the creation.

Declared In

AZSCloudAppendBlob.h

– createIfNotExistsWithCompletionHandler:

Creates the append blob on the service if it does not already exist.

- (void)createIfNotExistsWithCompletionHandler:(void ( ^ ) ( NSError *__AZSNullable , BOOL ))completionHandler

Parameters

completionHandler

The block of code to execute when the delete call completes. | Parameter name | Description | |—————-|————-| |NSError * | Nil if the operation succeeded without error, error with details about the failure otherwise.| |BOOL | YES if the blob was successfully created with this call. NO if the blob already existed.|

Discussion

Creates the append blob on the service if it does not already exist.

Unlike block blobs, append blobs must be explicitly created on the service before data can be written. This method does the creation.

Declared In

AZSCloudAppendBlob.h

– createIfNotExistsWithAccessCondition:requestOptions:operationContext:completionHandler:

Creates the append blob on the service if it does not already exist.

- (void)createIfNotExistsWithAccessCondition:(AZSNullable AZSAccessCondition *)accessCondition requestOptions:(AZSNullable AZSBlobRequestOptions *)requestOptions operationContext:(AZSNullable AZSOperationContext *)operationContext completionHandler:(void ( ^ ) ( NSError *__AZSNullable , BOOL ))completionHandler

Parameters

accessCondition

The access condition for the request.

requestOptions

The options to use for the request.

operationContext

The operation context to use for the call.

completionHandler

The block of code to execute when the delete call completes. | Parameter name | Description | |—————-|————-| |NSError * | Nil if the operation succeeded without error, error with details about the failure otherwise.| |BOOL | YES if the blob was successfully created with this call. NO if the blob already existed.|

Discussion

Creates the append blob on the service if it does not already exist.

Unlike block blobs, append blobs must be explicitly created on the service before data can be written. This method does the creation.

Declared In

AZSCloudAppendBlob.h

– appendBlockWithData:contentMD5:completionHandler:

Appends a block of data to the append blob.

- (void)appendBlockWithData:(NSData *)blockData contentMD5:(AZSNullable NSString *)contentMD5 completionHandler:(void ( ^ ) ( NSError *__AZSNullable , NSNumber *appendOffset ))completionHandler

Parameters

blockData

The data to append. Must be less than 4 MB.

contentMD5

Optional. The content-MD5 to use for transactional integrety for the appendBlock request. If contentMD5 is nil, and requestOptions.useTransactionalMD5 is set to YES, the library will calculate the MD5 of the block for you. This value is not stored on the service.

completionHandler

The block of code to execute when the append call completes. | Parameter name | Description | |—————-|————-| |NSError * | Nil if the operation succeeded without error, error with details about the failure otherwise.| |NSNumber * | The append offset for this append operation - the offset where this block was committed|

Discussion

Appends a block of data to the append blob.

Declared In

AZSCloudAppendBlob.h

– appendBlockWithData:contentMD5:accessCondition:requestOptions:operationContext:completionHandler:

Appends a block of data to the append blob.

- (void)appendBlockWithData:(NSData *)blockData contentMD5:(AZSNullable NSString *)contentMD5 accessCondition:(AZSNullable AZSAccessCondition *)accessCondition requestOptions:(AZSNullable AZSBlobRequestOptions *)requestOptions operationContext:(AZSNullable AZSOperationContext *)operationContext completionHandler:(void ( ^ ) ( NSError *__AZSNullable , NSNumber *appendOffset ))completionHandler

Parameters

blockData

The data to append. Must be less than 4 MB.

contentMD5

Optional. The content-MD5 to use for transactional integrety for the appendBlock request. If contentMD5 is nil, and requestOptions.useTransactionalMD5 is set to YES, the library will calculate the MD5 of the block for you. This value is not stored on the service.

accessCondition

The access condition for the request.

requestOptions

The options to use for the request.

operationContext

The operation context to use for the call.

completionHandler

The block of code to execute when the append call completes. | Parameter name | Description | |—————-|————-| |NSError * | Nil if the operation succeeded without error, error with details about the failure otherwise.| |NSNumber * | The append offset for this append operation - the offset where this block was committed|

Discussion

Appends a block of data to the append blob.

Declared In

AZSCloudAppendBlob.h

– createOutputStreamWithCreateNew:

Creates an output stream that is capable of writing to the blob.

- (AZSBlobOutputStream *)createOutputStreamWithCreateNew:(BOOL)createNew

Parameters

createNew

YES if the blob should be created from scratch (will overwrite a pre-existing blob), NO if the blob already exists and the stream data should be appended to the end.

Return Value

The created AZSBlobOutputStream, capable of writing to this blob.

Discussion

Creates an output stream that is capable of writing to the blob.

This method returns an instance of AZSBlobOutputStream. The caller can then assign a delegate and schedule the stream in a runloop (similar to any other NSOutputStream.) See AZSBlobOutputStream documentation for details.

Declared In

AZSCloudAppendBlob.h

– createOutputStreamWithCreateNew:accessCondition:requestOptions:operationContext:

Creates an output stream that is capable of writing to the blob.

- (AZSBlobOutputStream *)createOutputStreamWithCreateNew:(BOOL)createNew accessCondition:(AZSNullable AZSAccessCondition *)accessCondition requestOptions:(AZSNullable AZSBlobRequestOptions *)requestOptions operationContext:(AZSNullable AZSOperationContext *)operationContext

Parameters

createNew

YES if the blob should be created from scratch (will overwrite a pre-existing blob), NO if the blob already exists and the stream data should be appended to the end.

accessCondition

The access condition for the request.

requestOptions

The options to use for the request.

operationContext

The operation context to use for the call.

Return Value

The created AZSBlobOutputStream, capable of writing to this blob.

Discussion

Creates an output stream that is capable of writing to the blob.

This method returns an instance of AZSBlobOutputStream. The caller can then assign a delegate and schedule the stream in a runloop (similar to any other NSOutputStream.) See AZSBlobOutputStream documentation for details.

Declared In

AZSCloudAppendBlob.h

– uploadFromStream:createNew:completionHandler:

Uploades a blob from given source stream.

- (void)uploadFromStream:(NSInputStream *)sourceStream createNew:(BOOL)createNew completionHandler:(void ( ^ ) ( NSError *__AZSNullable ))completionHandler

Parameters

sourceStream

The stream containing the data that the blob should contain.

completionHandler

The block of code to execute when the upload call completes.

Parameter name Description
NSError * Nil if the operation succeeded without error, error with details about the failure otherwise.

Discussion

Uploades a blob from given source stream.

This operation will schedule the input sourceStream on a runloop (created in a new thread), and read in all data as long as it is able. This will chunk the data into blocks, and upload each of those blocks to the service. Finally, when the stream is finished, it will upload a block list consisting of all read data.

No more than one block’s worth of data will be uploaded at a time. Block size is configurable in the AZSBlobRequestOptions (see – uploadFromStream:accessCondition:requestOptions:operationContext:completionHandler:). Maximum number of outstanding downloads is also configurable in the AZSBlobRequestOptions.

Declared In

AZSCloudAppendBlob.h

– uploadFromStream:createNew:accessCondition:requestOptions:operationContext:completionHandler:

Uploades a blob from given source stream.

- (void)uploadFromStream:(NSInputStream *)sourceStream createNew:(BOOL)createNew accessCondition:(AZSNullable AZSAccessCondition *)accessCondition requestOptions:(AZSNullable AZSBlobRequestOptions *)requestOptions operationContext:(AZSNullable AZSOperationContext *)operationContext completionHandler:(void ( ^ ) ( NSError *__AZSNullable ))completionHandler

Parameters

sourceStream

The stream containing the data that the blob should contain.

accessCondition

The access condition for the request.

requestOptions

The options to use for the request.

operationContext

The operation context to use for the call.

completionHandler

The block of code to execute when the upload call completes.

Parameter name Description
NSError * Nil if the operation succeeded without error, error with details about the failure otherwise.

Discussion

Uploades a blob from given source stream.

This operation will schedule the input sourceStream on a runloop (created in a new thread), and read in all data as long as it is able. This will chunk the data into blocks, and upload each of those blocks to the service. Finally, when the stream is finished, it will upload a block list consisting of all read data.

No more than one block’s worth of data will be uploaded at a time. Block size is configurable in the AZSBlobRequestOptions. Maximum number of outstanding downloads is also configurable in the AZSBlobRequestOptions.

Declared In

AZSCloudAppendBlob.h