Re: creating a path from the container root
K R Viju <[email protected]>
| Newsgroups | gmane.comp.java.sun.servlet |
|---|---|
| Message-ID | <003f01c34ce6$00b33740$6d00a8c0@viju> |
at the least,
a simple replace("/", "\\") shud do the job.
Vj
----- Original Message -----
From: Tom K
To: [email protected]
Sent: Friday, July 18, 2003 5:20 AM
Subject: creating a path from the container root
I am trying to create a directory below the webapps\mywebapp directory.
I'am able to create directories with the java.io.File(new_directory)).mkdirs(); . (or mkdir())
However, I want to create it under the webapps\mywebapp directory,
To do this I need to get a path to the webapps\mywebapp directory so
I used request.getContextPath() which returns the correct path except that
The directory mywebapp comes back with a forward slash (e.g. /mywebapp)
When it should be a back slash (e.g. \mywebapp)
I've tried using the java.io.File.separator to make it UNIX/windows independent but
That doesn't work either!
HELP!
TK