We are facing few problems as regards to reading configuration file (say for e.g.
app.xml) which is inside the war file.
We have our configuration file inside the web-inf/classes folder inside the war
file.
We need to locate the file and use java.io classes to read it as well.
Question is :
When we use this.getClass().getResource("/WEB-INF/classes") method to locate ,
it returns the URL as
zip:<path of the war file>!<location inside the war file>
How should we go ahead and read the specific file using java.io classes ?
Any help on this is highly appreciated ........
Thanks,
Kumar
With the method you use, you need use java.util.zip package for further processing
to locate the entry you need.
WEB-INF/classes/app.xml
then do:
getClass().getResource("app.xml")
Consider using
http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Thread.html#getConte
xtClassLoader()
Cheers
mbg
"Kumar" <kkr...@hss.hns.com> wrote in message
news:3e5c...@newsgroups.bea.com...
> With the method you use, you need use java.util.zip package for further
processing
> to locate the entry you need.
I thougt that I have no access to the war file itself, so why using the zip
methodes ?
Thanks for clarification
Tomy