Skip to content

Commit

Permalink
Fix port of #3321 for 3.0.3 release
Browse files Browse the repository at this point in the history
Signed-off-by: Timothy Johnson <[email protected]>
  • Loading branch information
t1m0thyj committed Nov 15, 2024
1 parent a18d424 commit d1326e8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
1 change: 1 addition & 0 deletions packages/zowe-explorer/l10n/bundle.l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
"Profile is not authenticated, please log in to continue": "Profile is not authenticated, please log in to continue",
"Retrieving response from USS list API": "Retrieving response from USS list API",
"The 'move' function is not implemented for this USS API.": "The 'move' function is not implemented for this USS API.",
"Could not list USS files: Empty path provided in URI": "Could not list USS files: Empty path provided in URI",
"Profile does not exist for this file.": "Profile does not exist for this file.",
"Saving USS file...": "Saving USS file...",
"Renaming {0} failed due to API error: {1}/File pathError message": {
Expand Down
1 change: 1 addition & 0 deletions packages/zowe-explorer/l10n/poeditor.json
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@
"Profile is not authenticated, please log in to continue": "",
"Retrieving response from USS list API": "",
"The 'move' function is not implemented for this USS API.": "",
"Could not list USS files: Empty path provided in URI": "",
"Profile does not exist for this file.": "",
"Saving USS file...": "",
"Renaming {0} failed due to API error: {1}": "",
Expand Down
21 changes: 9 additions & 12 deletions packages/zowe-explorer/src/trees/uss/UssFSProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,15 @@ export class UssFSProvider extends BaseProvider implements vscode.FileSystemProv
public async listFiles(profile: imperative.IProfileLoaded, uri: vscode.Uri, keepRelative: boolean = false): Promise<IZosFilesResponse> {
const queryParams = new URLSearchParams(uri.query);
const ussPath = queryParams.has("searchPath") ? queryParams.get("searchPath") : uri.path.substring(uri.path.indexOf("/", 1));
let response: IZosFilesResponse;
try {
response = await ZoweExplorerApiRegister.getUssApi(profile).fileList(ussPath);
// If request was successful, create directories for the path if it doesn't exist
if (response.success && !keepRelative && response.apiResponse.items?.[0]?.mode?.startsWith("d") && !this.exists(uri)) {
await vscode.workspace.fs.createDirectory(uri.with({ query: "" }));
}
} catch (err) {
if (err instanceof Error) {
ZoweLogger.error(err.message);
}
throw err;
if (ussPath.length === 0) {
throw new imperative.ImperativeError({
msg: vscode.l10n.t("Could not list USS files: Empty path provided in URI"),
});
}
const response = await ZoweExplorerApiRegister.getUssApi(profile).fileList(ussPath);
// If request was successful, create directories for the path if it doesn't exist
if (response.success && !keepRelative && response.apiResponse.items?.[0]?.mode?.startsWith("d") && !this.exists(uri)) {
await vscode.workspace.fs.createDirectory(uri.with({ query: "" }));
}

return {
Expand Down

0 comments on commit d1326e8

Please sign in to comment.