Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ protected void setNotebookDirectory(String notebookDirPath) throws IOException {
LOGGER.info("Notebook dir doesn't exist: {}, creating it.",
rootNotebookFileObject.getName().getPath());
}
this.rootNotebookFolder = rootNotebookFileObject.getName().getPath();
// getPath() method returns a string without root directory in windows, so we use getURI() instead
// windows does not support paths with "file:///" prepended, so we replace it by "/"
this.rootNotebookFolder = rootNotebookFileObject.getName().getURI().replace("file:///", "/");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind to add some comment on this change to help others understand why call getURI().replace("file:///", "/")?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Muhammad-ms LGTM

}

@Override
Expand All @@ -110,7 +112,9 @@ private Map<String, NoteInfo> listFolder(FileObject fileObject) throws IOExcepti
noteInfos.putAll(listFolder(child));
}
} else {
String noteFileName = fileObject.getName().getPath();
// getPath() method returns a string without root directory in windows, so we use getURI() instead
// windows does not support paths with "file:///" prepended. so we replace it by "/"
String noteFileName = fileObject.getName().getURI().replace("file:///", "/");
if (noteFileName.endsWith(".zpln")) {
try {
String noteId = getNoteId(noteFileName);
Expand Down