hi all:
A xml file and some ejb classes are packed in a jar file.
In my class I want to read the xml file, just like
new FileInputStream("error-map.xml");
But how can I get the file path and the file resource?
thanks in advance
ray
-
Read a xml file in a .jar (2 messages)
- Posted by: ray qi
- Posted on: December 09 2003 02:55 EST
Threaded Messages (2)
- Read a xml file in a .jar by David Rabinowitz on December 09 2003 03:29 EST
- Read a xml file in a .jar by ray qi on December 09 2003 23:23 EST
-
Read a xml file in a .jar[ Go to top ]
- Posted by: David Rabinowitz
- Posted on: December 09 2003 03:29 EST
- in response to ray qi
You can use Class.getResourceAsStream(filename) which gives you an InputStream.
David -
Read a xml file in a .jar[ Go to top ]
- Posted by: ray qi
- Posted on: December 09 2003 23:23 EST
- in response to ray qi
thanks a lot
I get it
getClass().getClassLoader().getResourceAsStream("com/espacesoft/exception/error-map.xml")
thanks again