示例#1
0
 public static void AzCopy(this ICakeContext ctx, string source, string destination, Action<AzCopySettings> configure)
 {
     if (ctx.Environment.Platform.Family == PlatformFamily.OSX) throw new NotSupportedException("AzCopy is not supported on macOS");
     var settings = new AzCopySettings();
     configure?.Invoke(settings);
     ctx.AzCopy(source, destination, settings);
 }
示例#2
0
 public static AzCopySettings SetPayloadFormat(this AzCopySettings settings, string payloadFormat)
 {
     if (System.Enum.TryParse(payloadFormat, true, out PayloadFormat format))
     {
         settings.PayloadFormat = format;
     }
     return(settings);
 }
示例#3
0
 public static AzCopySettings SetConcurrentOperationsCount(this AzCopySettings settings, int count)
 {
     if (count <= 512)
     {
         settings.ConcurrentOperations = count;
     }
     return(settings);
 }
示例#4
0
 public static AzCopySettings SetBlobType(this AzCopySettings settings, string blobType)
 {
     if (System.Enum.TryParse(blobType, true, out BlobType type))
     {
         settings.BlobType = type;
     }
     return(settings);
 }
示例#5
0
        internal static ProcessArgumentBuilder BuildForLinux(this AzCopySettings settings, string source, string destination)
        {
            var args = new ProcessArgumentBuilder();

            args.AppendSwitchQuoted("--source", source);
            args.AppendSwitchQuoted("--destination", destination);
            args = settings.BuildLinuxArguments(args);
            return(args);
        }
示例#6
0
        internal static ProcessArgumentBuilder BuildForWindows(this AzCopySettings settings, string source, string destination)
        {
            var args = new ProcessArgumentBuilder();

            args.AppendSwitchQuoted("/Source", ":", source);
            args.AppendSwitchQuoted("/Dest", ":", destination);
            args = settings.BuildWindowsArguments(args);
            return(args);
        }
示例#7
0
 public static AzCopySettings SetContentType(this AzCopySettings settings, string contentType)
 {
     settings.TargetContentType = contentType;
     return(settings);
 }
示例#8
0
 public static AzCopySettings SetPayloadFormat(this AzCopySettings settings, PayloadFormat format)
 {
     settings.PayloadFormat = format;
     return(settings);
 }
示例#9
0
 public static AzCopySettings UseDelimiter(this AzCopySettings settings, char delimiter)
 {
     settings.Delimiter = delimiter;
     return(settings);
 }
示例#10
0
 public static AzCopySettings SetFileBehaviour(this AzCopySettings settings, FileHandling behaviour)
 {
     settings.FileHandlingBehaviour = behaviour;
     return(settings);
 }
示例#11
0
 public static AzCopySettings AddResponseFile(this AzCopySettings settings, FilePath responseFile)
 {
     settings.ParameterFiles.Add(responseFile);
     return(settings);
 }
示例#12
0
 public static AzCopySettings LogToFile(this AzCopySettings settings, FilePath logFile)
 {
     settings.LogFile = logFile;
     return(settings);
 }
示例#13
0
 public static AzCopySettings UsePattern(this AzCopySettings settings, string pattern)
 {
     settings.Pattern = pattern;
     return(settings);
 }
示例#14
0
 public static AzCopySettings EnableChecksums(this AzCopySettings settings, bool enablemd5 = true)
 {
     settings.UseChecksum = enablemd5;
     return(settings);
 }
示例#15
0
 public static AzCopySettings UseDestinationAccountKey(this AzCopySettings settings, string accountKey)
 {
     settings.DestinationKey = accountKey;
     return(settings);
 }
示例#16
0
 public static AzCopySettings CopyRecursively(this AzCopySettings settings, bool recursive = true)
 {
     settings.Recursive = recursive;
     return(settings);
 }
示例#17
0
 public static AzCopySettings UseSourceSignature(this AzCopySettings settings, string sas)
 {
     settings.SourceSAS = sas;
     return(settings);
 }
示例#18
0
 public static AzCopySettings UseDestinationSignature(this AzCopySettings settings, string sas)
 {
     settings.DestinationSAS = sas;
     return(settings);
 }
示例#19
0
 public static AzCopySettings UseSourceAccountKey(this AzCopySettings settings, string accountKey)
 {
     settings.SourceKey = accountKey;
     return(settings);
 }
示例#20
0
 public static AzCopySettings SetBlobType(this AzCopySettings settings, BlobType type)
 {
     settings.BlobType = type;
     return(settings);
 }
示例#21
0
 public static void AzCopy(this ICakeContext ctx, string source, string destination, AzCopySettings settings)
 {
     if (ctx.Environment.Platform.Family == PlatformFamily.OSX) throw new NotSupportedException("AzCopy is not supported on macOS");
     var runner = new AzCopyRunner(ctx);
     runner.RunTool(source, destination, settings);
 }