[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Props file and classpath question



I think classpath is for java class loader to find java class not for properties files.
If your question is how can I load properties files from local file system without put the full path or the root path  of the files  in java code,  here is the thing you do:
 
put this line in you code:
 
System.out.println("user dir: " + System.getProperty("user.dir"));
 
It will tell you where is you user dir. The rest thing is putting your files in that dir or a subfolder of it.
Usually you app server will be chick off at a default working directory, so user dir is not changed.
 
Hope this answers your question.
 
King
-----Original Message-----
From: Alain Nicolet [mailto:anicolet@spiredex.com]
Sent: Thursday, February 21, 2002 1:22 PM
To: ajug-members@www.ajug.org
Subject: Props file and classpath question

How do I get a properties file out of my classpath from within java code.  Is this possible?
I need to access multiple properties files from within an ejb(Stateless session).
I read the link put up a post ago (http://java.sun.com/j2se/1.4/docs/guide/lang/preferences.html) but it's not really what I need. 
 
 
Thanks,
 
Alain