WindowsFileSystemProvider checks that the URI path is only '/'. Uri works great as a URI, the problem is with the FileSystem props. crashystar has this right (I can not comment yet) and the Path should be used. If you read the JavaDoc newFileSystem (Path, ClassLoader), you will see that ClassLoader can be left null, so you just need to do
Path path = Paths.get("C:/Users/Rosetta/workspace/filesystemProject/fs/ext2"); FileSystem ext2fs = FileSystems.newFileSystem(path, null);
Leaving it in zero Java, it tries to find the installed provider (so you could not expect the custom provider to be used). If it were a custom provider, you would have to use ClassLoader, which can load this provider. If the provider is in your class path, it would be enough to do
getClass().getClassLoader()
Since you say you just want the OS to do this, leave it at zero.
source share