// Display list of source members in LIB/SRCPF public void ListMembers(string qsysPath) { if (!RegexUtils.MatchSrcPfPath(qsysPath)) { throw new KanpachiFormatException("Expected source physical file path of format LIB/SRCPF."); } var splitPath = qsysPath.ToUpper().Split('/'); (string lib, string spf) = (splitPath[0], splitPath[1]); using (KanpachiClient client = new KanpachiClient(Profile)){ foreach (SrcMbr mbr in client.GetSrcMbrList(lib, spf)) { Console.WriteLine(mbr); } } }
// 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); } } } }
// Download source physical file at LIB/SRCPF public void GetSpf(string qsysPath, string downloadPath) { if (!RegexUtils.MatchSrcPfPath(qsysPath)) { throw new KanpachiFormatException("Invalid QSYS path. Expected source physical file path of format LIB/SRCPF."); } var splitPath = qsysPath.ToUpper().Split('/'); (string lib, string spf) = (splitPath[0], splitPath[1]); using (KanpachiClient client = new KanpachiClient(Profile)){ SrcPf srcPf = client.GetSrcPfDetails(lib, spf); var members = client.GetSrcMbrList(lib, spf); foreach (SrcMbr srcMbr in members) { // TODO: progress output DownloadSrcMbr(client, downloadPath, lib, spf, srcMbr); } } }