wood burning stoves*
The moose likes Java in General and the fly likes reading a property file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "reading a property file" Watch "reading a property file" New topic
Author

reading a property file

Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
hello,

i'm looking for a pattern to read a custom property file. it seems as if my current design has a principle problems:

- i have a class PropertyReader which reads the file and adds it to the system properties


this code is called from a static initalizer block, a debug log output in the class itself shows that the file is read correctly, all properties can be accessed.

here's my problem when i execute my junit testsuite (from within an ant task):
- the file is read without problems (log output in PropertyReader is correct)
- from within a test, i can access the "normal" system properties (like file.seperator,...)
- but when i access my own properties, it always returns null.

many thanks for any help,

jan
 
Don't get me started about those stupid light bulbs.
 
subject: reading a property file
 
Similar Threads
properties file
java.io.FileNotFoundException: FileOutputStream error?
Creating Dynamic Object
Read Properties File from Applet.
File constructor puts a forward slash in the constructed path