Relative Pathname ifExists

I am trying to determine if a file exists using a relative path, but can't get it to work.

Example

String strURL= "../../../../../Dir/file.txt";

But when I do this code:

File file = new File(strURL);

if (file.exists() ) {

it never finds it . . Absolute path will work.

I guess I am not sure what path I am starting off in. Has anyone ever used this code in a JSP ? Thanks

[447 byte] By [joepriv1] at [2007-9-26 3:38:13]
# 1
If you are talking about file(s) directly or indirectly under your web/document root, you can use javax.servlet.ServletContext.getRealPath()
neville_sequeira at 2007-6-29 12:11:33 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...