Microsoft.WindowsAzure.MediaServices.Client.BlobUploader.GetCloudBlockBlob C# (CSharp) Method

GetCloudBlockBlob() private static method

private static GetCloudBlockBlob ( Uri uri, Microsoft.WindowsAzure.Storage.Blob.CloudBlobClient client, string subFolder, string localFile, string contentType, Func getSharedAccessSignature ) : Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob
uri System.Uri
client Microsoft.WindowsAzure.Storage.Blob.CloudBlobClient
subFolder string
localFile string
contentType string
getSharedAccessSignature Func
return Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob
        private static CloudBlockBlob GetCloudBlockBlob(
            Uri uri,
            CloudBlobClient client,
            string subFolder,
            string localFile,
            string contentType,
            Func<string> getSharedAccessSignature)
        {
            CloudBlobContainer blobContainer = null;
            CloudBlockBlob blob = null;
            if (client != null)
            {
                blobContainer = new CloudBlobContainer(uri, client.Credentials);
            }
            else
            {
                if (getSharedAccessSignature != null)
                {
                    string signature = getSharedAccessSignature();
                    blobContainer = new CloudBlobContainer(uri, new StorageCredentials(signature));
                }
                else
                {
                    blobContainer = new CloudBlobContainer(uri);
                }
            }

            string blobFileName = Path.Combine(subFolder, Path.GetFileName(localFile));
            blob = blobContainer.GetBlockBlobReference(blobFileName);
            blob.Properties.ContentType = contentType;
            return blob;
        }