I want to get File from project folder by using \"File class\" , How I can Do that ?
File file=new File(\"x1.txt\");
These lines worked in my case,
ClassLoader classLoader = getClass().getClassLoader(); File fi = new File(classLoader.getResource("test.txt").getFile());
provided test.txt file inside src