Beispiel #1
0
        static void RunOptions(Options opts)
        {
            //if (string.IsNullOrEmpty(opts.Extension) && !opts.Replace)
            //{

            //    return;
            //}

            CATFunctions.StartProcess("");
            CATFunctions.DisplayProcessnigAnimation(true);


            BlobServiceClient service = new BlobServiceClient(opts.ConnectionString);

            BlobContainerClient blobContainer = service.GetBlobContainerClient(opts.Container);


            Utility.Process(opts.SourceDirectory,
                            blobContainer,
                            opts.Extensions,
                            opts.MaxAgeSeconds,
                            opts.DefaultContenType,
                            opts.ClearContainer.GetValueOrDefault(),
                            opts.SyncContainer.GetValueOrDefault(),
                            opts.ExcludeDirs);


            CATFunctions.Print("Process is done.", true, false);


            CATFunctions.DisplayProcessnigAnimation(false);
            CATFunctions.EndProcess();
        }
        static void RunOptions(Options opts)
        {
            //if (string.IsNullOrEmpty(opts.Extension) && !opts.Replace)
            //{

            //    return;
            //}

            CATFunctions.StartProcess("");
            CATFunctions.DisplayProcessnigAnimation(true);


            CloudStorageAccount storageAccount;

            if (!string.IsNullOrEmpty(opts.StorageAccount) && !string.IsNullOrEmpty(opts.StorageKey))
            {
                storageAccount = new CloudStorageAccount(new StorageCredentials(opts.StorageAccount, opts.StorageKey), true);
            }
            else
            {
                return;
            }

            CloudBlobClient    blobClient    = storageAccount.CreateCloudBlobClient();
            CloudBlobContainer blobContainer = blobClient.GetContainerReference(opts.Container);


            Utility.Process(opts.SourceDirectory,
                            blobContainer,
                            opts.Extensions,
                            opts.MaxAgeSeconds,
                            opts.DefaultContenType,
                            opts.ClearContainer);


            if (opts.Wildcard)
            {
                Utility.SetWildcardCorsOnBlobService(storageAccount);
            }


            CATFunctions.Print("Process is done.", true, false);


            CATFunctions.DisplayProcessnigAnimation(false);
            CATFunctions.EndProcess();
        }