cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <gree...@hotmail.com>
Subject Re: OT question on getResource()
Date Thu, 11 May 2000 10:41:51 GMT
Donald Ball <balld@webslingerZ.com> wrote:
>From one package, how can I get a resource from another package? E.g., if
>I'm in
>
>org.apache.cocoon
>
>and I want the resource cocoon.properties, I just do this:
>
>getClass().getResource("cocoon.properties")
>
>but suppose I want, uh, org.apache.xalan.xalan.properties. this doesn't
>work:
>
>getClass().getResource("org.apache.xalan.xalan.properties")
>
>nor does this
>
>getClass().getClassLoader().getSystemResource("org.apache.xalan.xalan.properties")
>
>hmm, i kinda thought it would. any suggestions?

Well firstly there is no such file! ;)

Let's use a real example. Suppose I'm in package foo.bar.

IIRC,

org.apache.cocoon.Cooon.class.getResource ("cocoon.properties");

will work.

--
Robin

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


Mime
View raw message