David,
Thanks for the suggestion. I do do this from time to time, but there are
frequent cases where I need to manipulate the resources as files. Either I
need to check their attributesor it's not practical to put them on the
classpath, etc.
--Tony
Palmer, David wrote:
> This is what we do... we use
> getClass().getResourceAsStream("foo.properties");
> to load our properties file from the classpath, therefor we don't have to
> worry about the actual locations of said files.
>
> Dunno if this would work in your situation, but it works out nicely for us.
>
> I hope this helps
>
> ./dave
>
>
>>-----Original Message-----
>>From: Anthony Frey [mailto:ant...@co...]
>>Sent: Thursday, May 08, 2003 1:21 PM
>>To: wra...@li...
>>Subject: [Wrapper-user] Wrapper's current working directory
>>
>>
>>
>>First off, I must say this is one of the nicest Java service
>>wrappers I have
>>yet to use. It's flexibility and ease-of-use are unmatched!
>>Kudos and thanks
>>to Leif and the Wrapper team for making it available.
>>
>>I think I may be missing something with configuration that
>>I'm hoping someone
>>has some suggestions for.
>>
>>My standard practice has always been to write config files
>>for my Java
>>applications such that paths are relative to the "home"
>>directory of the
>>application. I also like to put executables (including
>>Wrapper) in a "bin"
>>directory. I know Wrapper is designed to always use the
>>executable directory
>>as the working directory and that relative paths can be used
>>in wrapper.conf
>>which is great because I can count on it.
>>
>>My problem is that all of my non-wrapper.conf config files
>>also need to be
>>"aware" of the location of the executable and specify
>>relative paths with a
>>'../' prefix. The solution I've come up with is to add a
>>"app.home" system
>>property that gets used as the base to all relative paths
>>throughout my
>>application. This is a little cumbersome though since this
>>needs to be done
>>everywhere throughout the application. Is it possible to set the Java
>>process's notion of the current working directory to this
>>"home" directory or
>>am I missing something else entirely?
>>
>>Thanks for the help,
>>-Tony
>>
>>
>>
>>-------------------------------------------------------
>>Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
>>The only event dedicated to issues related to Linux
>>enterprise solutions
>>www.enterpriselinuxforum.com
>>
>>_______________________________________________
>>Wrapper-user mailing list
>>Wra...@li...
>>https://lists.sourceforge.net/lists/listinfo/wrapper-user
>>
>
>
>
> "The sender believes that this E-mail and any attachments were free of any
> harmful and malicious code or defects when sent. This message and its
> attachments could have been infected during transmission. By reading the
> message and opening any attachments, the recipient accepts full
> responsibility for taking protective and remedial action regarding the code
> or such defects. The sender is not liable for any loss or damage arising in
> any way from this message or its attachments."
>
>
> -------------------------------------------------------
> Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
> The only event dedicated to issues related to Linux enterprise solutions
> www.enterpriselinuxforum.com
>
> _______________________________________________
> Wrapper-user mailing list
> Wra...@li...
> https://lists.sourceforge.net/lists/listinfo/wrapper-user
|