Function getResourceAsStream returns null while getResource returns a URL
<p>I encountered very strange problem, I hope you will be able to help me:
I run the following line:</p>

<pre><code>InputStream stream = this.getClass().getClassLoader().getResourceAsStream(SOME_PATH);
</code></pre>

<p>And it works.
Then, I create a new class loader that points to the same file, and then </p>

<pre><code>this.getClass().getClassLoader().getResourceAsStream(SOME_PATH)
</code></pre>

<p>returns null.</p>

<p>When I debug it, I saw that</p>

<pre><code>this.getClass().getClassLoader().getResource(SOME_PATH)
</code></pre>

<p>returns a valid URL object.</p>

<p>So, I debug the getResourceAsStream, and saw that it calls to getResource, and when it tries to open the steam - it fails on FileNotFoundException.</p>

<p>I have no idea how to solve it.
The stream is properly closed.</p>

<p>Anyone?</p>
