On Mon, 9 Dec 2002, Patrick Kosiol wrote:

> Date: Mon, 09 Dec 2002 12:34:30 +0100
> From: Patrick Kosiol <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: How to get a "File" for a certain folder
>
> Hi,
>
> how can I get a File-Object for a certain Folder placed under my
> $CATALINA_HOME/webapps/ROOT/ - Folder. I want to traverse over the files
> that are placed there.
> Can anyone help me?
>

There is no guarantee that there is such a thing as a folder for your
webapps -- it's entirely legal for servlet containers to run your app
directly from a WAR file.

For maximum portability, you should use the
ServletContext.getResourcePaths() method to give you the names of the
resources in a particular "directory" of your webapp -- this will work
whether or not the container actually runs your app from an unpacked
directory.

> thx
> Patrick

Craig



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

Reply via email to