Determing File directory path in JAVA - TechRepublic
General discussion
October 10, 2002 at 02:10 AM
cjk6723

Determing File directory path in JAVA

by cjk6723 . Updated 23 years, 9 months ago

I have built a JAVA class whose methods gets called from a JSP. This class obtains information from an INI file that is located in the META-INF directory within a given website(There are multiple websites) I need to determine the path of the META-INF directory for the current website in order to locate this INI file. Unfortunately, when I access it from the web, it is giving me a directory where the servlet class is being executed from and not the class package directory itself. How do I determine the current directory where the servlet class is actually located on the server itself? By the way, if I run it from regular JAVA with a main method and not through a web browser, it runs fine and locates the directory correctly.

This discussion is locked

All Comments