title: load file within a jar
body: <p>I need to package a configuration file within a jar.  the configuration file is under the root of the jar file.
  However I got the following error:</p>
  
  <blockquote>
    <p>Caused by: java.lang.IllegalArgumentException: URI is not hierarchical
      at java.io.File.(Unknown Source)</p>
  </blockquote>
  
  <pre><code>File url = new File(MyClass.class.getClassLoader().getResource("my.conf").toURI());
  </code></pre>