Hello all !! I need to read some data from a file that is in a jar form. until now, I used :
and it worked just fine, BUT , this works only if I am running it from the jar itself !, I now need to read from a different Jar !, can someone give me a hand here ? this is supposed to be simple, I don't really know why I got tangled up with this ....
Check out java.util.jar package. The classes JarFile, and JarEntry is what you need. You should be able to find a fair few examples too, if you google for it.
HTH.
Sonny
The future is here. It's just not evenly distributed yet. - William Gibson
Consultant @ Xebia. Sonny GillTweets
Pradeep Kadambar
Ranch Hand
Joined: Oct 18, 2004
Posts: 148
posted
0
Probably using the ClassLoader to load the resource will solve the problem. It doesn't matter as long as the resource is in the classpath.
Sathya Srinivasan
Ranch Hand
Joined: Jan 29, 2002
Posts: 379
posted
0
If you just want to read property files or images, you might want to consider ResourceBundle or Property classes, which can read anything present in the classpath (even if from another JAR file).
Thank you all ! And special thanks to Sonny Gill ! I used the JarFile and it worked like a charm ! I got it up and running in no time ! Thanks again Dave