Hi,

You can continue to use properties file, and here's an alternative to
hardcoding the file system path in your app.

First create a jar within which your properties file exists. For example, if
your property file is called props.ini you could put it with the path
"com/foo/props.ini" within some jar, say "comfoo.jar".

Place comfoo.jar in {ORIONHOME}/lib folder. You can bypass problems with
classpath settings by placing your jar file here.

Then, in your application where you use the properties file, get the
classloader and you can get the properties file as a resource. The following
code might be useful.

/* ----------------- */

Properties props = new Properties();
ClassLoader clsLdr = <object>.getClass().getClassLoader();
InputStream instr = clsLdr.getResourceAsStream("com/foo/props.ini");

props.load(instr);

/* ----------------- */

HTH,

-Srikanth

---------------------------------------------
Srikanth B.
Wipro Technologies,
Bangalore, India.
Email - [EMAIL PROTECTED]
http://www.wipro.com/ - Applying Thought
------------------------------------------------------------
----- Original Message -----
From: Holden Glova <[EMAIL PROTECTED]>
To: Orion-Interest <[EMAIL PROTECTED]>
Sent: Thursday, May 03, 2001 6:11 AM
Subject: property files or similar


> Hello,
>
> Aside from hardcoding a path to the
> properties file we are using, is there
> anywhere you specify these types of
> resources to orion instead of hardcoded
> in a class?
>
> What would be the alternative to using
> something like a property file, given
> that a property file is *very* easy to
> use?
>
> Many thanks in advance for your inputs.
>
> --
> Holden Glova, [EMAIL PROTECTED]
> Software Engineer
> Alchemy Group Limited
> Level 6 Royal Sun Alliance Bldg
> PO Box 2386
> Christchurch
> New Zealand
> Phone: +64 3 962-0396
> Fax: +64 3 962-0388
>


Reply via email to