Skip to content

Conversation

@Muhammad-ms
Copy link
Contributor

What is this PR for?

The rootNotebookFolder variable in VFSNotebookRepo.java does not contain the root directory in windows. For e.g. if notebook directory is "C:/Users/zeppelin-notes", the value of rootNotebookFolder set in VFSNotebookRepo.java:91 is "/Users/zeppelin-notes", which is not found in windows and throws an exception at launch.
Using this.rootNotebookFolder = rootNotebookFileObject.getName().getURI().replace("file:///", "/"); instead allows us to set the correct value for rootNotebookFolder (i.e. /C:/Users/zeppelin-notes).

Similarly, the noteFileName (VFSNotebookRepo.java:110) variable is missing root directory in windows and using String noteFileName = fileObject.getName().getURI().replace("file:///", "/"); fixes this.

What type of PR is it?

Bug Fix

What is the Jira issue?

THIS SOFTWARE IS CONTRIBUTED SUBJECT TO THE TERMS OF THE APACHE SOFTWARE FOUNDATION SOFTWARE GRANT AND CORPORATE CONTRIBUTOR LICENSE AGREEMENT VERSION R190612.

THIS SOFTWARE IS LICENSED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY WARRANTY OF NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THIS SOFTWARE MAY BE REDISTRIBUTED TO OTHERS ONLY BY EFFECTIVELY USING THIS OR ANOTHER EQUIVALENT DISCLAIMER IN ADDITION TO ANY OTHER REQUIRED LICENSE TERMS.

Muhammad-ms and others added 2 commits January 20, 2020 14:18
Catch up with the apache/zeppelin repository master branch
rootNotebookFileObject.getName().getPath());
}
this.rootNotebookFolder = rootNotebookFileObject.getName().getPath();
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants