| Author |
Reading Properties file in Jython
|
Jacob John
Greenhorn
Joined: Jun 21, 2004
Posts: 2
|
|
Hi All,
In my jython script i want to read a properties file like.
import java.util as util
import java.io as javaio
properties = util.Properties
#add try catch for this
propertiesfis =javaio.FileInputStream("wasconfig.properties")
properties.load( propertiesfis)
While running this script its showing the error
File "<string>", line 19, in ?
TypeError: load(): expected 2 args; got 1
But the java syntax for java.util.Properties.load() takes only one parameter. So what else jython is expecting here?
Can any one help me in this. Thanks in advance.
Regards
Jacob
|
 |
Jacob John
Greenhorn
Joined: Jun 21, 2004
Posts: 2
|
|
|
This got corrected. I had to use properties = util.Properties() instead of properties = util.Properties
|
 |
Marc Peabody
pie sneak
Sheriff
Joined: Feb 05, 2003
Posts: 4725
|
|
Ah, that makes sense. The util.Properties would be a reference to Properties.class rather than instantiating an instance of the Properties class.
Thanks for updating with the solution.
|
A good workman is known by his tools.
|
 |
 |
|
|
subject: Reading Properties file in Jython
|
|
|