Coen90 opened a new pull request, #5283: URL: https://github.com/apache/zeppelin/pull/5283
### What is this PR for? The folder `move(String folderPath, String newFolderPath, AuthenticationInfo subject)` method in `FileSystemNotebookRepo` creates the parent directory of the **source** folder instead of the **destination** folder before performing the move. Since the source folder must already exist for the move to succeed, creating its parent is redundant. Meanwhile the destination's parent directory may not exist, causing the subsequent move to fail — e.g. moving `/A/X` to `/B/X` when `/B` does not exist fails because the code creates `/A` (already present) instead of `/B`. This PR changes the `tryMkDir` call to use `newFolderPath` (the destination) instead of `folderPath` (the source), mirroring the existing behavior already present in the note `move()` overload. ```diff - this.fs.tryMkDir(new Path(notebookDir, folderPath.substring(1)).getParent()); + this.fs.tryMkDir(new Path(notebookDir, newFolderPath.substring(1)).getParent()); ``` ### What type of PR is it? Bug Fix ### Todos * [x] - Fix parent directory creation to target the destination folder ### What is the Jira issue? * https://issues.apache.org/jira/browse/ZEPPELIN-6415 ### How should this be tested? * Existing tests in `FileSystemNotebookRepoTest` cover the folder move flow. * Manual: move a folder into a destination whose parent directory does not yet exist (e.g. `/folder1` → `/folder2/folder3`) and verify the move succeeds and the parent (`/folder2`) is created. ### Screenshots (if appropriate) N/A ### Questions: * Does the license files need to update? No * Is there breaking changes for older versions? No * Does this needs documentation? No -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
