P
Piper707
Hi,
How do I find the container directory for a particular file when it
gets executed?
Ex:
c:\Tomcat\shared\lib\xyz.jar (xyz.jar contains abc.class)
I want to find out in which directory abc.class lies. If I try to find
the current directory from within the class using any of the following,
System.getProperty("user.dir");
String currentPath = new File(".").getPath();
String currentPath = new File(".").getCanonicalPath();
String currentPath = new File(".").getAbsolutePath();
I get "c:\win32" as my directory, probably because its the "current"
working directory for execution.
1) How can I get the path returned to be:
c:\Tomcat\shared\lib\ ?
2) Are these any Tomcat APIs that might help me get the full path of
where this file lies?
Thx for any help.
Rohit
How do I find the container directory for a particular file when it
gets executed?
Ex:
c:\Tomcat\shared\lib\xyz.jar (xyz.jar contains abc.class)
I want to find out in which directory abc.class lies. If I try to find
the current directory from within the class using any of the following,
System.getProperty("user.dir");
String currentPath = new File(".").getPath();
String currentPath = new File(".").getCanonicalPath();
String currentPath = new File(".").getAbsolutePath();
I get "c:\win32" as my directory, probably because its the "current"
working directory for execution.
1) How can I get the path returned to be:
c:\Tomcat\shared\lib\ ?
2) Are these any Tomcat APIs that might help me get the full path of
where this file lies?
Thx for any help.
Rohit