My automation script is failing in a Java project, as it has another java project as a library imported, in which I am reading a file named 'browserstack.parallel.conf.json' in the 'res' folder using
File f = new File(getClass().getClassLoader().getResource("browserstack.parallel.conf.json").getFile());
Also tried,
File f = new File("src/res/browserstack.parallel.conf.json");
but the file is not getting read and if(f.exists() && !f.isDirectory()) resulting in false.
What process should I follow for this scenario and solve this issue?