title: Velocity, different template paths
body: <p>Does anyone know if it is possible to get templates from different paths with velocity? After initialization Velocity refuses to change the "file.resource.loader.path". </p>
  
  <p>This is my code: </p>
  
  <pre><code>public Generator(){         
      Properties p = new Properties();
          p.setProperty("resource.loader", "file");
          p.setProperty("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader");
          p.setProperty("file.resource.loader.path", "");
  
      Velocity.init(p);
  }
  </code></pre>
  
  <p>The templates can be located in different locations ( the user can select one with a file dialog ). So I have this code upon fetching the template out of velocity</p>
  
  <pre><code>private Template fetch (String templatePath) {
      out_println("Initializing Velocity core...");
      int end = templatePath.lastIndexOf(File.separator); 
  
      Properties p = new Properties();
          p.setProperty("file.resource.loader.path", templatePath.substring(0, end));
      Velocity.init(p);
  
      return Velocity.getTemplate(templatePath.substring(end+1));
  }
  </code></pre>
  
  <p>This is not working. It seems that once Velocity is initialized it can't be reset with different properties. Any suggestions on how to solve this problem?</p>
  
  <p><strong>Possible Program flow:</strong></p>
  
  <ol>
  <li>User selects group that needs to be filled into the template </li>
  <li>User selects a template to use (can be located anywhere on the hdd)</li>
  <li>User presses generate</li>
  </ol>