xpipe-io/modulefs

How to install ModuleFsProvider?

plastiv opened this issue · 2 comments

This is likely my limited understanding of the setup, but readme lacks steps how to enable it in application project?

I have added implementation("io.xpipe:modulefs:0.1.5") as dependency, but observe runtime exception when trying to use it.

modulefs provider not found
java.nio.file.ProviderNotFoundException: modulefs provider not found
	at io.xpipe.modulefs.ModuleFileSystem.lambda$create$2(ModuleFileSystem.java:20)
	at java.base/java.util.Optional.orElseThrow(Optional.java:403)
	at io.xpipe.modulefs.ModuleFileSystem.create(ModuleFileSystem.java:20)
val resourcesFs = FileSystems.newFileSystem(
        URI.create("module:/com.example.test"),
        emptyMap<String, Any>()
    )

What do I need to do to add ModuleFS toFileSystemProvider.installedProviders()?

Does your project have a module-info? Once you add a requires directive for modulefs, it should be added as a service provider automatically.

Thank you for the fast response! I didn't realise that project has to be a module project to be used from modulefs (It's in the name 😅). That's was the issue.