Exemplo n.º 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;
        }
Exemplo n.º 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
     };
 }
Exemplo n.º 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
     };
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
        }
Exemplo n.º 6
0
 public Downloader(BlobUri blobUri, string storageAccountKey)
 {
     this.blobUri = blobUri;
     this.StorageAccountKey = storageAccountKey;
 }