Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 3
0
 public static AzCopySettings SetConcurrentOperationsCount(this AzCopySettings settings, int count)
 {
     if (count <= 512)
     {
         settings.ConcurrentOperations = count;
     }
     return(settings);
 }
Esempio n. 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);
 }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 7
0
 public static AzCopySettings SetContentType(this AzCopySettings settings, string contentType)
 {
     settings.TargetContentType = contentType;
     return(settings);
 }
Esempio n. 8
0
 public static AzCopySettings SetPayloadFormat(this AzCopySettings settings, PayloadFormat format)
 {
     settings.PayloadFormat = format;
     return(settings);
 }
Esempio n. 9
0
 public static AzCopySettings UseDelimiter(this AzCopySettings settings, char delimiter)
 {
     settings.Delimiter = delimiter;
     return(settings);
 }
Esempio n. 10
0
 public static AzCopySettings SetFileBehaviour(this AzCopySettings settings, FileHandling behaviour)
 {
     settings.FileHandlingBehaviour = behaviour;
     return(settings);
 }
Esempio n. 11
0
 public static AzCopySettings AddResponseFile(this AzCopySettings settings, FilePath responseFile)
 {
     settings.ParameterFiles.Add(responseFile);
     return(settings);
 }
Esempio n. 12
0
 public static AzCopySettings LogToFile(this AzCopySettings settings, FilePath logFile)
 {
     settings.LogFile = logFile;
     return(settings);
 }
Esempio n. 13
0
 public static AzCopySettings UsePattern(this AzCopySettings settings, string pattern)
 {
     settings.Pattern = pattern;
     return(settings);
 }
Esempio n. 14
0
 public static AzCopySettings EnableChecksums(this AzCopySettings settings, bool enablemd5 = true)
 {
     settings.UseChecksum = enablemd5;
     return(settings);
 }
Esempio n. 15
0
 public static AzCopySettings UseDestinationAccountKey(this AzCopySettings settings, string accountKey)
 {
     settings.DestinationKey = accountKey;
     return(settings);
 }
Esempio n. 16
0
 public static AzCopySettings CopyRecursively(this AzCopySettings settings, bool recursive = true)
 {
     settings.Recursive = recursive;
     return(settings);
 }
Esempio n. 17
0
 public static AzCopySettings UseSourceSignature(this AzCopySettings settings, string sas)
 {
     settings.SourceSAS = sas;
     return(settings);
 }
Esempio n. 18
0
 public static AzCopySettings UseDestinationSignature(this AzCopySettings settings, string sas)
 {
     settings.DestinationSAS = sas;
     return(settings);
 }
Esempio n. 19
0
 public static AzCopySettings UseSourceAccountKey(this AzCopySettings settings, string accountKey)
 {
     settings.SourceKey = accountKey;
     return(settings);
 }
Esempio n. 20
0
 public static AzCopySettings SetBlobType(this AzCopySettings settings, BlobType type)
 {
     settings.BlobType = type;
     return(settings);
 }
Esempio n. 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);
 }