I have a resource file I need to load at runtime...it is in src/main/resources
I have successfully loaded the file to an inputStream using :
LoadSAC.class.getClassLoader().getResourceAsStream("someFile.txt");
LoadSAC is the class name ...
However, PMD complains about this suggests I use
Thread.currentThread().getContextClassLoader().getResource(...)
I have tried numerous combinations and can never get the file to be located... Any thoughts... I have trolled a number of searches with plenty of suggestions but none seem to work...
Any thoughts ?