title: Load a resource in Jar
body: <p>Below is structure of my <code>Jar</code> file</p>
  
  <pre><code>root
   - template.ftl
   - org.project.myproject.App.java
  </code></pre>
  
  <p>Inside App.java, I have a line of code that expects me to specify the <code>directory</code> for loading the <code>template.ftl</code>. Something like:</p>
  
  <pre><code>Line#1: cfg.setDirectoryForTemplateLoading("java.io.File object that represents /directory/for/storing/template/files");
  </code></pre>
  
  <p>and the next line of code, read the template file</p>
  
  <pre><code>Line#2: Template temp = cfg.getTemplate("template.ftl");
  </code></pre>
  
  <p>My problem is that I'm not able to specify the path of directory from where the file will be loaded. The template file to load is available in root of the <code>Jar</code>. When I write,</p>
  
  <pre><code>cfg.setDirectoryForTemplateLoading(new File("."));
  </code></pre>
  
  <p>It says, <code>template.ftl</code> not found.</p>
  
  <p>What should be apprpriate code that can set the template directory correctly at <code>Line#1</code> above?</p>