In NetBeans (Java Application Project) if I put a file in the root directory of a project NetBeans can find the file. For example
FileReader reader = new FileReader(new File("test.txt"));
Here test.txt file is in the root directory of the project. This is what the root directory look like.
-> Project Folder
--> build
--> nbproject
--> src
--> test
--> build.xml
--> manifest.mf
--> test.txt
I have tried putting a file in the root directory of an eclipse dynamic web project with the same code. But it cannot find the file. This is what the root directory for eclipse looks like.
-> Project Folder
--> .settings
--> build
--> src
--> .classpath
--> .project
--> test.txt
In which location does eclipse search for files by default? Is it different for different types of projects?