getting the absolute path of the app
Hi!
I'd like to obtain the absolute path of the folder of the application within the code of the web service.
How can I do this?
I tried with
File f = new File(".");
String p=f.getAbsolutePath();
but it does not work
With best regards,
Sorin
# 1
not sure how your web service is structured...
If u're able to access the HttpRequest object, u can simply do this: HttpServletRequest.getContextPath(), and this should give u the path to the Tomcat (or whatever server u're running) directory where yr web service application is in.
hope this help..