Convert resource/stream to File
<p>How can I do this?</p>

<pre><code>File myFile = getFile(this.getClass.getResourceAsStream("test.txt"))
</code></pre>

<p>OR</p>

<pre><code>File myFile = getFile(this.getClass.getResource("test.txt"))
</code></pre>

<p>What code will I write in <code>getFile()</code> method?</p>
