Пример #1
0
        /// <summary>
        /// Creates the tape storage factory for windows Azure storage.
        /// </summary>
        /// <param name="config">Azure storage configuration to create tape storage with.</param>
        /// <param name="containerName">Name of the container.</param>
        /// <param name="initializeForWriting">if set to <c>true</c>, then storage is initialized for writing as needed.</param>
        /// <returns></returns>
        public static BlobTapeStorageFactory CreateTape(this IAzureStorageConfig config, string containerName)
        {
            var factory = new BlobTapeStorageFactory(config, containerName);

            factory.InitializeForWriting();
            return(factory);
        }
Пример #2
0
        /// <summary>
        /// Creates the tape storage factory for windows Azure storage.
        /// </summary>
        /// <param name="config">Azure storage configuration to create tape storage with.</param>
        /// <param name="containerName">Name of the container.</param>
        /// <param name="initializeForWriting">if set to <c>true</c>, then storage is initialized for writing as needed.</param>
        /// <returns></returns>
        public static BlobTapeStorageFactory CreateTape(IAzureStorageConfig config, string containerName, bool initializeForWriting = true)
        {
            var factory = new BlobTapeStorageFactory(config, containerName);

            if (initializeForWriting)
            {
                factory.InitializeForWriting();
            }
            return(factory);
        }
Пример #3
0
 static Server BuildServer(string containerName, string storageConnectionString)
 {
     var account = CloudStorageAccount.Parse(storageConnectionString);
     var cloudBlobClient = account.CreateCloudBlobClient();
     var tapeStorageFactory = new BlobTapeStorageFactory(cloudBlobClient, containerName);
     tapeStorageFactory.InitializeForWriting();
     Func<string, ITapeStream> streamFactory = tapeStorageFactory.GetOrCreateStream;
     return new Server(streamFactory);
 }