0 Replies Latest reply on Apr 22, 2015 1:35 PM by omid pourhadi

    VFS does not load resource files inside a jar

    omid pourhadi Apprentice

      Hi,

       

      I'm using JBoss AS 7.3Final and I want to load a jasper file inside a jar file with following code.

      When I explode the ear file, it works fine but after I deploy the ear file as archive jboss vfs can not load the resource.

       

      public String getJasperDirectory(){
         URL resUrl = Env.class.getClassLoader().getResource("reports");
          VirtualFile vf = VFS.getchild(resUrl);
         System.out.println(vf.getPathName()); //returns vfs:/content as archive .. returns correct path when exploded
      }
      
      

       

      the project structure is as follow :

       

      - myproj.ear
      |- myproj-ejb.jar
      |- reports
      
      

       

      I'm looking for a way to support both. is there anyway to load the resource file from the archive ?