Esempio n. 1
0
        private static void Main(string[] args)
        {
            BlobEndpoint destination = null, source = null;

            var program = new Program();
            bool parse = program.ParseTokens(args);
            if (!parse)
                return;

            var sourceEndpointState = new BlobEndpointState()
            {
                AccountName = program.SourceCopyAccount,
                AccountKey = program.SourceAccountKey,
                ContainerName = program.SourceCopyContainer,
                BlobName = program.BlobName,
                Async = program.DoAsync,
                Force = program.Force
            };

            var destinationEndpointState = new BlobEndpointState()
            {
                AccountName = program.DestinationCopyAccount,
                AccountKey = program.DestinationAccountKey,
                ContainerName = program.DestinationCopyContainer,
                BlobName = program.BlobName,
                Async = program.DoAsync,
                Force = program.Force
            };
            destination = new BlobEndpoint(destinationEndpointState);

            if (program.HttpEndpoint != null)
            {
                source = new BlobEndpoint(program.HttpEndpoint);
            }
            else
            {
                source = new BlobEndpoint(sourceEndpointState);
            }

            int timeTaken = program.BlobName != null ? source.CopyBlobTo(destination) : source.CopyAllBlobsTo(destination);

            if (program.DoAsync)
                Console.WriteLine("All blobs copied asynchronously");
            else
                Console.WriteLine("All blobs copied in {0} seconds", timeTaken);

            Console.WriteLine("Press [q] to exit");
            ConsoleKeyInfo info;
            do
            {
                info = Console.ReadKey();
            } while (info.Key != ConsoleKey.Q);
        }
Esempio n. 2
0
 /// <summary>
 /// Used toconstruct a blob endpoint
 /// </summary>
 /// <param name="state">Contains the details to derive the blob endpoint</param>
 public BlobEndpoint(BlobEndpointState state)
 {
     EndpointState = state;
 }