If you look carefully you will notice that the method getPath
from FileSystem
object returns implementation of Path interface. By invoking FileSystems.getDefault()
you will retrieve implementation of FileSystem
interface which will depend on system. On Linux system you will get LinuxFileSystem
object witch extends UnixFileSystem
class.
You can look for example at UnixFileSystem
class from openjdk which is implementation of FileSystem
interface.
Here is the link with implementation of getPath
method from UnixFileSystem, which will return instance of UnixPath.
You must remember that FileSystems.getDefault
return implementation dependent on the operating system. Furthermore source code of those classes isn't available in oracle jdk.