I am working on creating a custom file system based on the link. I have created a CustomFileSystemProvider
(and other CustomFileSystem classes) and overridden the required methods. The getScheme()
method of the CustomFileSystemProvider
returns the string "myfs".
However when I try to test this file system with the following code
FileSystem fs = FileSystems.newFileSystem(URI.create("myfs://a_remote_resource"), env);
I get an error
java.nio.file.ProviderNotFoundException: Provider "myfs" not found
at java.nio.file.FileSystems.newFileSystem(FileSystems.java:341)
at java.nio.file.FileSystems.newFileSystem(FileSystems.java:276)
at Tester.main(Tester.java:30)
I don't see my custom file system in the list returned by FileSystemProvider.installedProviders()
. I am not sure what I need to register a custom FS as an "installedProvider".