I have a project with a graphical editor (like GMF technology) and I need read a file placed on a .Jar library that is on the classpath of the project.
The VectorSync_1.0.0.201403121100.jar have a structure like :
VectorSync:
- icons/VectorSync.gif
- model/VectorSync.xml
- program/VectorSync.java
- META-INF/MANIFEST.MF
The .classpath of the project where i imported the .Jar File is:
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/home/jperezmedina/git/arom/arom-core/target/scala-2.9.0/aromslave_2.9.0-0.1.jar"/>
<classpathentry kind="lib" path="/home/jperezmedina/runtime-EclipseApplication/DefaultProject.arom/lib/VectorSync_1.0.0.201403121100.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
I used this method to try acces a .xml file:
JarFile file = new JarFile("VectorSync_1.0.0.201403121100.jar");
BufferedReader input1 =
new BufferedReader(new InputStreamReader(file.getClass().
getClassLoader().getResourceAsStream("model/VectorSync.xml")));
But the method used return all times null
.
Could you help me to solve this problem?
Thanks