You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by "Weaver, Scott" <Sw...@rippe.com> on 2001/11/14 23:15:18 UTC

RE: How do I get the absolute file to something in the Resources dire ctory?

Try ServletContext.getRealPath().  You should be able to get the
ServletContext object from the RunData instance.

ServletContext.getRealPath("Resources/tmp/your.xml")

would return (I think as a java.net.url):

/TOMCAT_HOME/webapps/myapp/Resources/tmp/your.xml

I use this all the time to get conf information from the WEB-INF directory
(IMOHO, I feel it is better to stick configuration info in WEB-INF because
it is secured from browsing by default).

Scott

-----Original Message-----
From: Pugh, Eric [mailto:EPugh@MuseumCompany.com]
Sent: Wednesday, November 14, 2001 3:38 PM
To: 'Turbine Users List'
Subject: How do I get the absolute file to something in the Resources
dire ctory?


Hi all,

I want to store some configuration information and temp data about my
application in some XML files..  I was going to put them in
\webapps\myapp\Resources\tmp\*.xml

However, I can't figure out how, from inside turbine, to get that path?  I
thought I could use the contentURI object to tell me, but it gives me a
website relative url, not a filesystem url..  

The reason I don't want to use the TurbineResourcesService to store my data
is that some of it is application specific data, and some may be very
changable.

Any ideas?

Eric




--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>