Hi all,
I am trying to make a reference to a config file that is located in a jar.
I am doing this by te following: file = new FileInputStream(sConfigFileName);
where the sConfigFileName is supposed be the path to the config file. But what I want to do is reference to a file in a jar. Does anybody know what to give as path to the config file?
greetz,
Wout
-
reference to txt file in jar (2 messages)
- Posted by: wout vanduffel
- Posted on: January 19 2004 04:19 EST
Threaded Messages (2)
- reference to txt file in jar by David Rabinowitz on January 19 2004 05:39 EST
- mmmm by wout vanduffel on January 20 2004 03:47 EST
-
reference to txt file in jar[ Go to top ]
- Posted by: David Rabinowitz
- Posted on: January 19 2004 05:39 EST
- in response to wout vanduffel
Try using Class.getResourceAsStream().
David -
mmmm[ Go to top ]
- Posted by: wout vanduffel
- Posted on: January 20 2004 03:47 EST
- in response to David Rabinowitz
doesnt seem to work...
I read the file as follows:
FileInputStream file = (FileInputStream)this.getClass().getResourceAsStream(sConfigFileName);
sConfigFileName is the string : config.txt
The file is located at the root of the jar file...