You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Madhava Reddy <Ma...@icon-scm.com> on 2003/01/20 12:07:02 UTC

RE: How do I get the absolute path of a file in a directory above WEB-INF directory of my web application?

-----Original Message-----
From: Holger Klawitter [mailto:holger@klawitter.de]
Sent: Monday, January 20, 2003 11:00 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?


> 	java.io.File dir1 = new java.io.File ("..\\"); // line 1

new java.io.File( ".." + File.separator ) would be a somewhat cleaner.

yes that's better.

more over, we can use suitabe seperators depending on the operating system.
I guess for Unix system this must be a forward slash "/". I'm not sure
whether its "/" or "//"

Madhava Reddy

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>

OT: on File.separator (was: How do I get the absolute path ...)

Posted by Holger Klawitter <li...@klawitter.de>.
Hai,

> > 	java.io.File dir1 = new java.io.File ("..\\"); // line 1
> new java.io.File( ".." + File.separator ) would be a somewhat cleaner.
> more over, we can use suitabe seperators depending on the operating system.

File.separator already gives you the Separator for the current OS.

> I guess for Unix system this must be a forward slash "/". I'm not sure
> whether its "/" or "//"

You know why you have to type "\\" instead of "\" in Java, don't you? ;-)

Regards,
	Holger


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>