[jboss-user] [Microcontainer] - Re: Using the VFS to read a resource from nested jars

scott.stark@jboss.org do-not-reply at jboss.com
Wed Dec 13 12:31:07 EST 2006


The jar urls are gone in the current snaphsot. You do not need to go through the URL to read a resource. You can use the openStream method of the VirtualFile:


  |       VirtualFile jar1MF = jar1.findChild("META-INF/MANIFEST.MF");
  |       assertNotNull("jar1!/META-INF/MANIFEST.MF", jar1MF);
  |       InputStream mfIS = jar1MF.openStream();
  |       Manifest mf1 = new Manifest(mfIS);
  |       Attributes mainAttrs1 = mf1.getMainAttributes();
  |       String title1 = mainAttrs1.getValue(Attributes.Name.SPECIFICATION_TITLE);
  |       assertEquals("jar1", title1);
  |       jar1MF.close();
  | 


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993481#3993481

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993481



More information about the jboss-user mailing list