title: Resource loading using ClassLoader
body: <p>I have a resource file I need to load at runtime...it is in <code>src/main/resources</code></p>
  
  <p>I have successfully loaded the file to an inputStream using :</p>
  
  <pre><code>LoadSAC.class.getClassLoader().getResourceAsStream("someFile.txt");
  </code></pre>
  
  <p><code>LoadSAC</code> is the class name ...</p>
  
  <p>However, PMD complains about this suggests I use </p>
  
  <pre><code>Thread.currentThread().getContextClassLoader().getResource(...)
  </code></pre>
  
  <p>I have tried numerous combinations and can never get the file to be located... Any thoughts... I have trolled a number of searches with plenty of suggestions but none seem to work...</p>
  
  <p>Any thoughts ?</p>