Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

Loading files from the classpath throws FileSystemNotFoundException #703

@MaSven

Description

@MaSven

I have a test-resource folder where my data sits for testing purpose. I have to load the testdata as File because this is what my API excepts. I thought i could easily load a File from my Resource path with

assert (exists Resource resource = `module test.space.smarquardt.csvparser`.resourceByPath("TestNormal.csv"));
value csvPath = parseURI(resource.uri);

But this will trow an FileSystemNotFoundException.
Is there a better way to load resources as Files? I thought this would work like in Java with

new File(this.getClass().getResource("foo.txt").toUri());

that would give me a File.
It seems to be that the uri starts with classpath:// an there is no filesystem activated for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions