// Display list of source physical files public void ListSpfs(string qsysPath) { if (!RegexUtils.MatchIbmiObject(qsysPath)) { throw new KanpachiFormatException("Expected name of library."); } using (KanpachiClient client = new KanpachiClient(Profile)){ foreach (SrcPf spf in client.GetSrcPfList(qsysPath)) { Console.WriteLine(spf); } } }
// Download entire library public void GetLibrary(string lib, string downloadPath) { if (!RegexUtils.MatchIbmiObject(lib)) { throw new KanpachiFormatException("Invalid library name"); } using (KanpachiClient client = new KanpachiClient(Profile)){ var spfs = client.GetSrcPfList(lib); foreach (SrcPf spf in spfs) { var members = client.GetSrcMbrList(lib, spf.Name); foreach (SrcMbr srcMbr in members) { // TODO: progress output DownloadSrcMbr(client, downloadPath, lib, spf.Name, srcMbr); } } } }