I have a file, ("hwc.bat") stored inside of my projects resources folder: "project/res/HWC/hwc.bat".
I am writing code from within a class "/src/test/java/.../aTest.java"
I want to be able to retrieve the absolute path of the file hwc.bat, but using getResource isn't working for me. Here's what I've been trying:
final URL resource = this.getClass().getClassLoader().getResource("hwc.bat");
absolutePath = Paths.get(resource.toURI()).toString();
I've tried plenty of variations of "hwc.bat", including things like "/hwc.bat", or "/res/HWC/hwc.bat", but I can't seem to get the URL to be anything but null.
Here is a picture of my project set-up, just to give a better idea of where the file is and what I'm trying to do/the context of everything.