本文整理汇总了C#中IStorageBlobManagement.GetBlobReferenceFromServer方法的典型用法代码示例。如果您正苦于以下问题:C# IStorageBlobManagement.GetBlobReferenceFromServer方法的具体用法?C# IStorageBlobManagement.GetBlobReferenceFromServer怎么用?C# IStorageBlobManagement.GetBlobReferenceFromServer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IStorageBlobManagement
的用法示例。
在下文中一共展示了IStorageBlobManagement.GetBlobReferenceFromServer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartCopyBlob
/// <summary>
/// Start copy operation by container name and blob name
/// </summary>
/// <param name="srcContainerName">Source container name</param>
/// <param name="srcBlobName">Source blob name</param>
/// <param name="destContainer">Destinaion container name</param>
/// <param name="destBlobName">Destination blob name</param>
/// <returns>Destination ICloudBlob object</returns>
private void StartCopyBlob(IStorageBlobManagement SrcChannel, IStorageBlobManagement destChannel, string srcContainerName, string srcBlobName, string destContainerName, string destBlobName)
{
ValidateBlobName(srcBlobName);
ValidateContainerName(srcContainerName);
ValidateContainerName(destContainerName);
if (string.IsNullOrEmpty(destBlobName))
{
destBlobName = srcBlobName;
}
ValidateBlobName(destBlobName);
AccessCondition accessCondition = null;
BlobRequestOptions options = RequestOptions;
CloudBlobContainer container = SrcChannel.GetContainerReference(srcContainerName);
ICloudBlob blob = SrcChannel.GetBlobReferenceFromServer(container, srcBlobName, accessCondition, options, OperationContext);
if (blob == null)
{
throw new ResourceNotFoundException(String.Format(Resources.BlobNotFound, srcBlobName, srcContainerName));
}
CloudBlobContainer destContainer = destChannel.GetContainerReference(destContainerName);
Func<long, Task> taskGenerator = (taskId) => StartCopyInTransferManager(taskId, destChannel, blob, destContainer, destBlobName);
RunTask(taskGenerator);
}
示例2: GetDestinationBlobWithCopyId
/// <summary>
/// Get DestinationBlob with specified copy id
/// </summary>
/// <param name="container">CloudBlobContainer object</param>
/// <param name="blobName">Blob name</param>
/// <param name="copyId">Current CopyId</param>
/// <returns>Destination ICloudBlob object</returns>
private ICloudBlob GetDestinationBlobWithCopyId(IStorageBlobManagement destChannel, CloudBlobContainer container, string blobName)
{
AccessCondition accessCondition = null;
BlobRequestOptions options = RequestOptions;
ICloudBlob blob = destChannel.GetBlobReferenceFromServer(container, blobName, accessCondition, options, OperationContext);
return blob;
}
示例3: StopCopyBlob
/// <summary>
/// Stop copy operation by CloudBlobContainer
/// </summary>
/// <param name="container">CloudBlobContainer object</param>
/// <param name="blobName">Blob name</param>
/// <param name="copyId">Copy id</param>
private async Task StopCopyBlob(long taskId, IStorageBlobManagement localChannel, CloudBlobContainer container, string blobName, string copyId)
{
ValidateBlobName(blobName);
ValidateContainerName(container.Name);
AccessCondition accessCondition = null;
BlobRequestOptions options = RequestOptions;
ICloudBlob blob = localChannel.GetBlobReferenceFromServer(container, blobName, accessCondition, options, OperationContext);
if (blob == null)
{
throw new ResourceNotFoundException(String.Format(Resources.BlobNotFound, blobName, container.Name));
}
await StopCopyBlob(taskId, localChannel, blob, copyId);
}