In the Java 7 source code the class, Paths has a method - get(URI).
Within get(URI) exists:
return FileSystems.getDefault().provider().getPath(uri);
FileSystems.getDefault()
returns a reference to the default filesystem. But then, according to the docs, .provider()
closes the file system and then .getPath(uri)
is called. Could someone explain to me what is going on? Why does the file system seem to be closed and then returned?
It would be great if someone could give me the blow-by-blow on what is occurring in that return statement.