Skip to content

Commit

Permalink
Fix PDS members in fetchDataset
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Santos <[email protected]>
  • Loading branch information
benjamin-t-santos committed Oct 17, 2024
1 parent cc16ff1 commit 0515e76
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions packages/zowe-explorer/src/trees/dataset/DatasetFSProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,32 @@ export class DatasetFSProvider extends BaseProvider implements vscode.FileSystem
const uriPath = uri.path.substring(uriInfo.slashAfterProfilePos + 1).split("/");
const pdsMember = uriPath.length === 2;
if (!entryExists) {
const resp = await ZoweExplorerApiRegister.getMvsApi(uriInfo.profile).dataSet(entryIsDir ? uriPath[0] : path.parse(uriPath[0]).name, {
attributes: true,
});
if (resp.success) {
const dsorg: string = resp.apiResponse?.items?.[0]?.dsorg;
entryIsDir = pdsMember ? false : dsorg?.startsWith("PO") ?? false;
if (pdsMember) {
const resp = await ZoweExplorerApiRegister.getMvsApi(uriInfo.profile).allMembers(uriPath[0], {
attributes: true,
});
const memberName = path.parse(uriPath[1]).name;
if (
resp.success &&
resp.apiResponse?.items?.length > 0 &&
resp.apiResponse.items.find((respItem) => respItem.member === memberName)
) {
entryIsDir = false;
} else {
throw vscode.FileSystemError.FileNotFound(uri);
}
} else {
throw vscode.FileSystemError.FileNotFound(uri);
const resp = await ZoweExplorerApiRegister.getMvsApi(uriInfo.profile).dataSet(uriPath[0], {
attributes: true,
});
if (resp.success && resp.apiResponse?.items?.length > 0) {
const dsorg: string = resp.apiResponse?.items?.[0]?.dsorg;
entryIsDir = pdsMember ? false : dsorg?.startsWith("PO") ?? false;
} else {
throw vscode.FileSystemError.FileNotFound(uri);
}
}
}

if (entryIsDir) {
if (!entryExists) {
this.createDirectory(uri);
Expand Down

0 comments on commit 0515e76

Please sign in to comment.