当前位置: 首页>>代码示例>>C#>>正文


C# IStorageBlobManagement.GetBlobReferenceFromServer方法代码示例

本文整理汇总了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);
        }
开发者ID:B-Rich,项目名称:azure-sdk-tools,代码行数:35,代码来源:StartAzureStorageBlobCopy.cs

示例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;
 }
开发者ID:B-Rich,项目名称:azure-sdk-tools,代码行数:14,代码来源:StartAzureStorageBlobCopy.cs

示例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);
        }
开发者ID:EmmaZhu,项目名称:azure-sdk-tools,代码行数:23,代码来源:StopAzureStorageBlobCopy.cs


注:本文中的IStorageBlobManagement.GetBlobReferenceFromServer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。