public List <FileInfo> GetFiles(TargetConfig target) { var result = new List <FileInfo>(); if (target.Exclude != null) { result.AddRange(CrawlDirectories(target.Exclude)); } if (target.Pick != null) { result.AddRange(Pick(target.Pick)); } return(result); }
private TargetConfig ParseTarget(KeyValuePair <string, string> command, List <string> parameters, Config config) { var options = ParseDictonary(parameters); var result = new TargetConfig { Name = command.Value, Ftp = GetFtp(options.GetIfHasKey("ftp"), config.Ftp), Exclude = GetFilter(options.GetIfHasKey("exclude"), config.Exclude), Pick = GetFilter(options.GetIfHasKey("pick"), config.Pick), Directory = options.GetIfHasKey("Directory"), CleanupDisable = options.GetIfHasKey("cleanup-disable").EqualsIgnoreCase("true"), OK = options.GetIfHasKey("ok") }; if (result.Ftp == null) { throw new ConfigException($"{nameof(ParseTarget)}: {nameof(result.Ftp)} [{command.Value}] not found."); } return(result); }
private List <FileInfo> GetFiles(TargetConfig target) => IFileEnumerator.GetFiles(target);