my prior, working code:
directory structure:
src/main/java/mypackage/myclass src/main/resources/mypackage/somefile.txt
in code:
uri uri = myclass.class.getresource("somefile.txt").touri();
now changed this:
directory structure:
src/main/java/de.abc.mypackage/myclass src/main/resources/de.abc.mypackage/somefile.txt
in code:
uri uri = myclass.class.getresource("somefile.txt").touri();
or
uri uri = myclass.class.getresource("de.abc.mypackage/somefile.txt").touri();
in both cases, doesn't find file, nullpointerexception.
what need change?
i think should use path src/main/resources/de/abc/mypackage/somefile.txt
Comments
Post a Comment