The following code throws java.nio.file.FileSystemNotFoundException when run. What might be the reason?
Path p = Paths.get(new URI("file://e:/temp/records"));
The following code throws java.nio.file.FileSystemNotFoundException when run. What might be the reason?
Path p = Paths.get(new URI("file://e:/temp/records"));
You have incorrectly specified the uri, it is missing a /
. Try running these in JSHELL to see that the correct value is "file:///e:/temp/records"
:
Paths.get(new URI("file://e:/temp/records"))
==> \\e\temp\records [ INCORRECT PATH]
Paths.get("e:\\temp\\records").toUri()
==> file:///e:/temp/records
Paths.get(new URI("file:///e:/temp/records"))
==> e:\temp\records [ CORRECT PATH TO E: ]