My project structure:
/myProject/
src/
main/...
test/
resources/
myFile.txt
When I put the file under the main project folder:
/myProject/
myFile.txt
src/
main/...
test/
resources/
My call works:
String myFile = "myFile.txt";
isFileThere(myFile);
However, when I put the file in the resources folder and build the relative path to it, it doesn't work:
String myFile = "myFile.txt";
String fullPath = String.format("/src/test/resources/%s", myFile);
isFileThere(fullPath);
***
java.io.FileNotFoundException: \src\test\resources\myFile.txt (The system cannot
find the path specified)
at java.base/java.io.FileInputStream.open0(Native Method)