I try to read a .txt file line by line in my code, which I placed it just right under the /src/ directory, when I run it with test case or with static void main
/src/
To read files from the root of the classpath use (eclipse automatically copies any non java file from src to classes):
this.getClass().getClassLoader().getResourceAsStream("filename.txt");
So you don't have to mess with the current folder at all.