I want to load a resource which is located inside of the /datatest folder in my project workspace. So, the whole file will be /datatest/a.xml .. How do I get the absolute path of this resource that I need in unit tests, since the unit test could be run on any machine I do not want to hardcode it but get it instead from using the classloader ? How do I do it ?
Share
If it’s in your classpath, then this should work: