Peter, 

this may help you,

try{
        java.io.File dir1 = new java.io.File ("..\\"); // line 1
        System.out.println ("Current dir : " + dir1.getCanonicalPath());
        String[] contents = dir1.list();
        if(contents != null)
                for(int i=0;i<contents.length;i++)
                        System.out.println ("\n"+contents[i]);
}
catch(Exception e) {
        e.printStackTrace();
}


First try to go to root directory( by adding more ..\\) , from there loop
through the sub directories, find matching file name. Query for the
canonical path for that file, you will get the exact path.

I supplied you part of code, Hope this helps

Madhava Reddy


-----Original Message-----
From: Christopher Mark Balz [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 20, 2003 9:54 AM
To: Tomcat Users List
Subject: Re: How do I get the absolute path of a file in a directory
above WEB-INF directory of my web application?


I don't know offhand how you can do that, but if you want to reach up 
above the WEB-INF directory, you can use dot-dot (..).
 - CB

Peter Lee wrote:

>I am using Tomcat for servlets. 
>How  do I get the absolute path of a file in a directory above WEB-INF
>directory of my 
>web application?
>
>Thanks
>
>
>--
>To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>  
>


-- 
". . . / This Cabinet is formd of Gold / And Pearl & Crystal shining bright
And within it opens into a World / . . .
Another England there I saw / Another London with its Tower
Another Thames & other Hills / And another pleasant Surrey Bower
. . ."
- from "The Crystal Cabinet", a poem by William Blake.



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

Reply via email to