I have a project where I want to access a resource in a JAR from another project. It's not on my classpath, so ClassLoader is not an option. I tried:
new FileInputStream("C:\\mydir\\my.jar!\\myresource.txt");
and received a FileNotFoundException.
JarInputStream might be a possibility, but I want the flexibility of the input filename being a jar resource or just a file on the system (user decides). Is there a class that can do this or do I have to build one myself?
URLs are your friend
URL.openStream
.
Fortunately, the desicion with the "!" symbol doesn't work.
Have a look here:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4730642
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With