tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
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 <>
> Reply-To: Tomcat Users List <>
> To: Tomcat Users List <>
> 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

> thx
> Patrick


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message