title: Access the folder from jar file
body: <p>I am trying to use a jar file which itself is a web application in another web project. In my jar which i have created using eclipse's export to jar functionality, I have stored owl files in a folder. To use relative paths in the code in the jar I access it using</p>
  
  <pre><code>MyClass.class.getResource("/folderName").getPath(); 
  </code></pre>
  
  <p>and this works fine when I deploy (glassfish) and use the project as a separate application. But when I am using the same from within another project, i changed the path like:</p>
  
  <pre><code> BufferedReader br = new BufferedReader(new InputStreamReader(MyClass.class.getResourceAsStream("/folderName"), "UTF-8"));
  
  ArrayList&lt;File&gt; filesFromCommonOntology = new ArrayList&lt;File&gt;();
  while(str = br.readLine() != null)
  {
    File f = new File(line);
    System.out.println(f);
    filesFromCommonOntology.add(f);
  }
  for (int i = 0; i &lt; filesFromCommonOntology.size(); i++)
  {
  
  file =  filesFromCommonOntology.get(i);
      String filePath = file.getPath();
      Model timeModel = FileManager.get().loadModel(filePath,
  ApplicationConstants.N3);
    }
  </code></pre>
  
  <p>But when i run the project i get null pointer exception for line</p>
  
  <pre><code>BufferedReader br = new BufferedReader(new InputStreamReader(MyClass.class.getResourceAsStream("/folderName"), "UTF-8"));
  </code></pre>
  
  <p>How to resolve this problem?</p>