C# Class Azure.Storage.BlobStorage

Simple helper class for Windows Azure storage blobs
Inheritance: IBlobStorage
Mostrar archivo Open project: cmatskas/Azure.Storage

Public Methods

Method Description
AddDataToAppendBlockBlob ( string blobId, string data ) : string

Adds data to the end of an Append blob. Should be used within a single writer as the code is not optimised for concurrent writers

BlobStorage ( string blobContainerName, string storageConnectionString, bool isPublic = true ) : System

Creates a new BlobStorage object

CreateBlockBlob ( string blobId, string filePath ) : string

Creates a new block blob and populates it from a file

CreateBlockBlob ( string blobId, string contentType, Stream data ) : string

Creates a new block blob and populates it from a stream

CreateBlockBlob ( string blobId, string contentType, byte data ) : string

Creates a new block blob and populates it from a byte array

CreateBlockBlob ( string blobId, string contentType, string data ) : string

Creates a new block blob and populates it from a string

DeleteBlob ( string blobId ) : void

Deletes the block blob with the given unique blob name

DeleteBlobContainer ( ) : void

Deletes the blob container

GetAppendBlockBlobReference ( string blobId ) : Microsoft.WindowsAzure.Storage.Blob.CloudAppendBlob

Gets a reference to an Append blob by blob id/name

GetBlockBlobDataAsStream ( string blobId ) : Stream

Returns as stream with the contents of a block blob with the given blob name

GetBlockBlobDataAsString ( string blobId ) : string

Returns as string with the contents of a block blob with the given blob name

GetBlockBlobReference ( string blobId ) : Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob

Gets a reference to a block blob with the given unique blob name

ListBlobsInContainer ( ) : IEnumerable

Returns a list of all the blobs in a container

Method Details

AddDataToAppendBlockBlob() public method

Adds data to the end of an Append blob. Should be used within a single writer as the code is not optimised for concurrent writers
public AddDataToAppendBlockBlob ( string blobId, string data ) : string
blobId string
data string
return string

BlobStorage() public method

Creates a new BlobStorage object
public BlobStorage ( string blobContainerName, string storageConnectionString, bool isPublic = true ) : System
blobContainerName string The name of the blob to be managed
storageConnectionString string The connection string pointing to the storage account (this can be local or hosted in Windows Azure
isPublic bool
return System

CreateBlockBlob() public method

Creates a new block blob and populates it from a file
public CreateBlockBlob ( string blobId, string filePath ) : string
blobId string The blobId for the block blob
filePath string
return string

CreateBlockBlob() public method

Creates a new block blob and populates it from a stream
public CreateBlockBlob ( string blobId, string contentType, Stream data ) : string
blobId string The blobId for the block blob
contentType string The content type for the block blob
data Stream The data to store in the block blob
return string

CreateBlockBlob() public method

Creates a new block blob and populates it from a byte array
public CreateBlockBlob ( string blobId, string contentType, byte data ) : string
blobId string The blobId for the block blob
contentType string The content type for the block blob
data byte The data to store in the block blob
return string

CreateBlockBlob() public method

Creates a new block blob and populates it from a string
public CreateBlockBlob ( string blobId, string contentType, string data ) : string
blobId string The blobId for the block blob
contentType string The content type for the block blob
data string The data to store in the block blob
return string

DeleteBlob() public method

Deletes the block blob with the given unique blob name
public DeleteBlob ( string blobId ) : void
blobId string The unique block blob identifier
return void

DeleteBlobContainer() public method

Deletes the blob container
public DeleteBlobContainer ( ) : void
return void

GetAppendBlockBlobReference() public method

Gets a reference to an Append blob by blob id/name
public GetAppendBlockBlobReference ( string blobId ) : Microsoft.WindowsAzure.Storage.Blob.CloudAppendBlob
blobId string
return Microsoft.WindowsAzure.Storage.Blob.CloudAppendBlob

GetBlockBlobDataAsStream() public method

Returns as stream with the contents of a block blob with the given blob name
public GetBlockBlobDataAsStream ( string blobId ) : Stream
blobId string
return Stream

GetBlockBlobDataAsString() public method

Returns as string with the contents of a block blob with the given blob name
public GetBlockBlobDataAsString ( string blobId ) : string
blobId string
return string

GetBlockBlobReference() public method

Gets a reference to a block blob with the given unique blob name
public GetBlockBlobReference ( string blobId ) : Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob
blobId string The unique block blob identifier
return Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob

ListBlobsInContainer() public method

Returns a list of all the blobs in a container
public ListBlobsInContainer ( ) : IEnumerable
return IEnumerable