예제 #1
0
        protected void PopulateFromBlobUrl(string url)
        {
            BlobUri blobUri;

            if (BlobUri.TryParse(url, out blobUri))
            {
                SetProperty(ref containerUrl, blobUri.ContainerUri.ToString(), ValidateContainerUrl, ContainerUrlPropertyName);
                SetProperty(ref accountKey, blobUri.AccountKey, ValidateNonEmptyString, AccountKeyPropertyName);
                SetProperty(ref blobName, blobUri.BlobName, ValidateNonEmptyString, BlobNamePropertyName);
                SetBlobUrl(url);
            }
        }
예제 #2
0
        protected static BlobReference GetBlobReference(string url)
        {
            BlobUri blobUri;

            if (!BlobUri.TryParse(url, out blobUri))
            {
                throw Errors.InvalidBlobUrl();
            }

            return(new BlobReference(
                       new CloudBlobContainer(
                           blobUri.ContainerUri,
                           new StorageCredentials(blobUri.AccountName, blobUri.AccountKey)),
                       blobUri.BlobName));
        }