In DynamicWebProject - Eclipse, How to get File Object for file present in src folder, i mean to say class path.
Below program works fine but new update to file is present in wtpwebapps, instead i want to get changed in file present in src folder of Eclipse only(How to get FileOutputStream for file present in classpath).
String filename1 = "/WEB-INF/classes/server123.properties";
ServletContext context = req.getSession().getServletContext();
String path1 = context.getRealPath(filename1);
System.out.println("PATH 1 IS :"+path1);
FileInputStream fis1 = new FileInputStream(new File(path1));
int ch1;
while ((ch1 = fis1.read())!=-1) {
System.out.print((char)ch1);
}
fis1.close();
FileOutputStream fos = new FileOutputStream(path1);
fos.write("jayesh".getBytes());
fos.close();