Getting the exact location of the config files
I have two questions regarding my java project. We are making use of a jar file which takes the location of the configuration.txt as one of the parameter and the output of that is an image file which we need to store on temp basis.
The configuration file is placed inside the WebContent folder.
Here is what I am doing currently
String configFile = "/configuration.txt";
String outFile = "/images/output.png";
String path = request.getSession().getServletContext().getRealPath("/");
outFile = path+outFile;
configFile = path+configFile;
1. Is this the best way to get the location of the configFile?
2. As the o/p of this program is an image file, whats the best place to store it temporarily.
My code is currently reading the conf file from
D:\Documents and Settings\username\My Documents\project\abc\.metadata\.plugins\org.eclip se.wst.server.core\tmp0\abc.ear\abc.war\configurat ion.txt
and storing the image at
D:\Documents and Settings\username\My Documents\project\abc\.metadata\.plugins\org.eclip se.wst.server.core\tmp0\abc.ear\abc.war\images\out put.png