Register / Login
Win a copy of
Spring in Action (5th edition)
this week in the
this forum made possible by our volunteer staff, including ...
Stephan van Hulst
Programmer Certification (OCPJP)
Chapter 9 Paths vs FileSystems (URI resource)
posted 9 months ago
I've been reading the OCJP 8 (
OCP 8 Programmer II Study Guide written by Jeanne Boyarsky and Scott Selikoff).
I'm in the middle of Chapter 9. And i've noticed strange thing (for me).
section they wrote:
Paths.get( new URI("http://www.selikoff.net"));
and after that in
Accessing the Underlying FileSystem Object
section they introduced:
FileSystem fileSystem = FileSystems.getFileSystem( new URI("http://www.selikoff.net"));
And both generate
This is my code:
FileSystem fileSystem = FileSystems.getFileSystem( new URI("http://www.selikoff.net")); Path path = fileSystem.getPath("duck.txt");
Why does it throw an exception? I've found this topic
but it's not clear.
I cannot find the solution why this code doesnt work. What's the concrete reason?
Boost this thread!
Passed OCP Java SE 8 Upgrade Exam (1Z0-813) with 91%
OCJP Wall Of Fame
OCJP 1Z0-809 preparation