tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: How to get a "File" for a certain folder
Date Wed, 11 Dec 2002 01:33:33 GMT


On Mon, 9 Dec 2002, Patrick Kosiol wrote:

> Date: Mon, 09 Dec 2002 12:34:30 +0100
> From: Patrick Kosiol <kosiol@simu.de>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> 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:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message