title: Java properties containing dollar delimited variables
body: <p>I'm storing my app settings in properties file that I use in Ant and in the Java app. Maybe it's not good pratice, but I find it very handy to avoid duplications. The file contains variables such as:</p>
  
  <pre><code>usefulstuff.dir = ${user.home}/usefulstuff
  </code></pre>
  
  <p>So that other people can run the program on *nix systems, provided that they have the usefulstuff folder in their home directory.</p>
  
  <p>Now, the fascinating thing is that this properties file works fine in <strong>Ant</strong> (the variable gets resolved to <code>/home/username</code>), while when I load the same file directly in the Java app, I get a string containing <code>${user.home}/usefulstuff</code>, which is not very useful indeed.</p>
  
  <p>I load the props with this code in Ant:</p>
  
  <pre><code>   &lt;loadproperties srcFile="myProps.properties"/&gt;
  </code></pre>
  
  <p>And in the Java app:</p>
  
  <pre><code>    FileInputStream ins = new FileInputStream(propFilePath);
      myProps.load(ins);
      ins.close();
  </code></pre>
  
  <p>Am I missing anything? Maybe is there a better way to load properties in a Java app than <code>load()</code>?</p>