public void run() { var ll = new LocalLister(); var localfiles = ll.getList(pathRoot, null, fileRE); if (!string.IsNullOrWhiteSpace(fileRE)) { var re = new System.Text.RegularExpressions.Regex(fileRE , System.Text.RegularExpressions.RegexOptions.Compiled | System.Text.RegularExpressions.RegexOptions.IgnoreCase); localfiles = localfiles.Where(x => re.IsMatch(x.path)).ToList(); } var locdiffs = localfiles.Select(x => new FileDiff { local = x, remote = null, type = DiffType.created }); var dp = new DiffProcessor { account = account, container = container, maxTasks = 10, root = pathRoot, encKey = key }; dp.noAction = noAction; dp.progressHandler = progress; dp.runType = RunType.upload; dp.add(locdiffs); dp.run(); }
public IReadOnlyList <FileDiff> run() { Regex reex = null; Regex re = null; maxTasks = BUCommon.IOUtils.DefaultTasks(maxTasks); var ll = new LocalLister(); var localfiles = ll.getList(pathRoot, exclude, filter); var remoteFiles = (new FileList { account = account, cache = cache, container = container, versions = false, useRemote = useRemote, pathRE = null } ).run(); if (!string.IsNullOrWhiteSpace(filter)) { re = new Regex(filter, RegexOptions.Compiled | RegexOptions.IgnoreCase); remoteFiles = remoteFiles.Where(x => re.IsMatch(x.path)).ToList(); } if (!string.IsNullOrWhiteSpace(exclude)) { reex = new Regex(exclude, RegexOptions.Compiled | RegexOptions.IgnoreCase); remoteFiles = remoteFiles.Where(x => !reex.IsMatch(x.path)).ToList(); } var dd = new DirDiff(); if (useHash) { dd.usehash = true; dd.privateKey = privateKey; dd.pathRoot = pathRoot; } dd.maxTasks = this.maxTasks; var diffs = dd.compare(localfiles, remoteFiles); /* filter out unknowns, sames */ return(diffs .Where(x => x.type == DiffType.created || x.type == DiffType.updated || x.type == DiffType.deleted) .ToList()); }