> From: Ludwig Magnusson [mailto:lud...@itcatapult.com]
> Subject: Problems finding the right filepath
> 
> We are a team developing a webapp running on a tomcat server.

What version of Tomcat?  (Be precise.)  What JVM?

> We need to list the files in a certain directory in our 
> application, but we cannot find a way to always get the
> correct path on the different platforms and environments.

Can you let the DefaultServlet do it?  Directory listings are normally 
disabled, but you can enable them for your particular webapp if you wish

Note that there is no requirement for a servlet container (e.g., Tomcat) to 
provide *any* access to the underlying file system (if there is one at all), 
other than to a scratch area for the webapp's internal use.  If your webapp is 
deployed as a .war file, there is no file structure to look at.

> Is this solvable through some IO-function or do we need
> to specify the path to our project in each environment?

You will likely need to specify the path through an environment variable, Java 
system property, or within the webapp <Context> element, via a nested 
<Parameter> or <Environment> setting.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to