Пример #1
0
        public static bool TryParseUri(Uri uri, out BlobUri blobUri)
        {
            blobUri = null;
            string storageAccountName;
            string storageDomainName;
            string blobContainerName;
            string blobName;
            string queryString;
            string secret;

            var result = TryParseUri(uri,
                                     out storageAccountName,
                                     out storageDomainName,
                                     out blobContainerName,
                                     out blobName,
                                     out queryString,
                                     out secret);

            if (!result)
            {
                return false;
            }
            blobUri = new BlobUri(uri, storageAccountName, storageDomainName, blobContainerName, blobName, queryString);
            return true;
        }
Пример #2
0
 public Downloader(BlobUri blobUri, string storageAccountKey, string locaFilePath)
 {
     this.parameters = new DownloaderParameters
     {
         BlobUri = blobUri,
         LocalFilePath = locaFilePath,
         ConnectionLimit = DefaultConnectionLimit,
         StorageAccountKey = storageAccountKey,
         ValidateFreeDiskSpace = false,
         ProgressDownloadStatus = Program.SyncOutput.ProgressDownloadStatus,
         ProgressDownloadComplete = Program.SyncOutput.ProgressDownloadComplete
     };
 }
Пример #3
0
 public Downloader(BlobUri blobUri, string storageAccountKey, string locaFilePath)
 {
     this.parameters = new DownloaderParameters
     {
         BlobUri                  = blobUri,
         LocalFilePath            = locaFilePath,
         ConnectionLimit          = DefaultConnectionLimit,
         StorageAccountKey        = storageAccountKey,
         ValidateFreeDiskSpace    = false,
         ProgressDownloadStatus   = Program.SyncOutput.ProgressDownloadStatus,
         ProgressDownloadComplete = Program.SyncOutput.ProgressDownloadComplete
     };
 }
Пример #4
0
 public BlobHandle(BlobUri blobUri, string storageAccountKey)
 {
     this.blobUri = blobUri;
     this.storageAccountKey = storageAccountKey;
     var blobClient = new CloudBlobClient(new Uri(this.blobUri.BaseUri), new StorageCredentials(this.blobUri.StorageAccountName, this.storageAccountKey));
     this.container = blobClient.GetContainerReference(this.blobUri.BlobContainerName);
     this.container.FetchAttributes();
     this.pageBlob = this.container.GetPageBlobReference(blobUri.BlobName);
     this.blobRequestOptions = new BlobRequestOptions
                                   {
                                       ServerTimeout = TimeSpan.FromMinutes(5),
                                       RetryPolicy = new LinearRetry(TimeSpan.FromMinutes(1), 3)
                                   };
     this.pageBlob.FetchAttributes(new AccessCondition(), blobRequestOptions);
 }
Пример #5
0
        public BlobHandle(BlobUri blobUri, string storageAccountKey)
        {
            this.blobUri           = blobUri;
            this.storageAccountKey = storageAccountKey;
            var blobClient = new CloudBlobClient(new Uri(this.blobUri.BaseUri), new StorageCredentials(this.blobUri.StorageAccountName, this.storageAccountKey));

            this.container = blobClient.GetContainerReference(this.blobUri.BlobContainerName);
            this.container.FetchAttributes();
            this.pageBlob           = this.container.GetPageBlobReference(blobUri.BlobName);
            this.blobRequestOptions = new BlobRequestOptions
            {
                ServerTimeout = TimeSpan.FromMinutes(5),
                RetryPolicy   = new LinearRetry(TimeSpan.FromMinutes(1), 3)
            };
            this.pageBlob.FetchAttributes(new AccessCondition(), blobRequestOptions);
        }
Пример #6
0
 public Downloader(BlobUri blobUri, string storageAccountKey)
 {
     this.blobUri = blobUri;
     this.StorageAccountKey = storageAccountKey;
 }