Пример #1
0
        /// <summary>
        /// NB Not using GetBlobReferenceFromServer for destination as this requires a lot of complex exception handling.
        /// </summary>
        public static CloudBlockBlob?GetBlobDirect(this IStorageAccountConfig config, string relativePath, AccessCondition?ac = null)
        {
            var sourceAccount    = CloudStorageAccount.Parse(config.ConnectionString);
            var sourceBlobClient = sourceAccount.CreateCloudBlobClient();

            return(sourceBlobClient.GetBlobReferenceFromServer(
                       new StorageUri(new Uri(sourceBlobClient.BaseUri, relativePath)), ac) as CloudBlockBlob);
        }
Пример #2
0
        /// <summary>
        /// Use for source blobs
        /// </summary>
        public static CloudBlockBlob GetBlobIndirect(this IStorageAccountConfig config, string relativePath)
        {
            var destinationAccount    = CloudStorageAccount.Parse(config.ConnectionString);
            var destinationBlobClient = destinationAccount.CreateCloudBlobClient();
            var containerName         = relativePath.Split("/", StringSplitOptions.RemoveEmptyEntries)[0];
            var path = string.Join("/", relativePath.Split("/", StringSplitOptions.RemoveEmptyEntries).Skip(1));
            var containerReference = destinationBlobClient.GetContainerReference(containerName);

            return(containerReference.GetBlockBlobReference(path));
        }
Пример #3
0
 public MutableBlobCopyCommand(IStorageAccountConfig sourceStorageAccountConfig, IStorageAccountConfig destinationStorageAccountConfig)
 {
     _SourceStorageAccountConfig      = sourceStorageAccountConfig;
     _DestinationStorageAccountConfig = destinationStorageAccountConfig;
 }
Пример #4
0
        public StorageClientEx(IStorageAccountConfig storageAccountConfig)
        {
            var c = CloudStorageAccount.Parse(storageAccountConfig.ConnectionString);

            _BlobClient = new CloudBlobClient(c.BlobEndpoint, c.Credentials);
        }
 public BlobWriterBase(IStorageAccountConfig storageAccountConfig)
 {
     _StorageAccountConfig = storageAccountConfig;
 }
Пример #6
0
 public StandardBlobWriter(IStorageAccountConfig storageAccountConfig) : base(storageAccountConfig)
 {
 }
Пример #7
0
 public ManifestBlobWriter(IStorageAccountConfig storageAccountConfig) : base(storageAccountConfig)
 {
 }