title: Load a resource contained in a jar
body: <p>In my application I load resources in this manner:</p>
  
  <pre><code>WinProcessor.class.getResource("repository").toString();
  </code></pre>
  
  <p>and this gives me:</p>
  
  <pre><code>file:/root/app/repository   (and I replace "file:" with empty string)
  </code></pre>
  
  <p>This works fine when I run my application from the IDE, but when I run the jar of my application:</p>
  
  <pre><code>java -jar app.jar
  </code></pre>
  
  <p>The path becomes:</p>
  
  <pre><code>jar:/root/app.jar!/repository
  </code></pre>
  
  <p>is there any way to solve this problem?</p>
  
  <p>I'll use the "repository" dir name in order to create this:</p>
  
  <pre><code>ConfigurationContext ctx = (ConfigurationContext) ConfigurationContextFactory.createConfigurationContextFromFileSystem(repositoryString, null);
  </code></pre>
  
  <p>In the same manner, I'll get one file name (instead of a dir) and I'll use it this way:</p>
  
  <pre><code>System.setProperty("javax.net.ssl.trustStore", fileNameString)
  </code></pre>