Example #1
0
        public void TestAZCopyOption()
        {
            var copyOption = new AZCopyOption();

            Assert.Equal(string.Empty, copyOption.ToCommandLineString());

            copyOption.BlobType = "BlockBlob";
            Assert.Equal("--blob-type \"BlockBlob\"", copyOption.ToCommandLineString());

            // set flag as true
            copyOption.Recursive = string.Empty;
            Assert.Equal("--blob-type \"BlockBlob\" --recursive", copyOption.ToCommandLineString());
        }
Example #2
0
        public async Task CopyAsync(IAZCopyLocation src, IAZCopyLocation dst, AZCopyOption option, CancellationToken ct = default)
        {
            // Locations must be in quotes. It could have spaces in the name and the CLI would interpret as separate parameters.
            var args = $"copy \"{src.LocationToString()}\" \"{dst.LocationToString()}\" {option.ToCommandLineString()} --output-type=json --cancel-from-stdin";

            await this.StartAZCopyAsync(args, ct);
        }