code: public static Properties readProperties( InputStream stream, Properties mappings, boolean closeStream )
          throws IOException
      {
          try
          {
              Properties p = new Properties();
              p.load( stream );
              mappings.putAll( p );
              boolean doAgain = true;
              while( doAgain )
              {
                  doAgain = false;
                  for( Map.Entry<Object, Object> entry : p.entrySet() )
                  {
                      String value = (String) entry.getValue();
                      if( value.indexOf( "${" ) >= 0 )
                      {
                          value = resolveProperty( mappings, value );
                          entry.setValue( value );
                          doAgain = true;
                      }
                  }
              }
              return p;
          }
          finally
          {
              if( closeStream )
              {
                  stream.close();
              }
          }
      }
docs: Read a set of properties from a property file provided as an Inputstream.
  <p/>
  Property files may reference symbolic properties in the form ${name}. Translations occur from both the
  <code>mappings</code> properties as well as all values within the Properties that are being read.
  </p>
  <p/>
  Example;
  </p>
  <code><pre>
  Properties mappings = System.getProperties();
  Properties myProps = PropertiesUtils.readProperties( "mine.properties", mappings );
  </pre></code>
  <p/>
  and the "mine.properties" file contains;
  </p>
  <code><pre>
  mything=${myplace}/mything
  myplace=${user.home}/myplace
  </pre></code>
  <p/>
  then the Properties object <i>myProps</i> will contain;
  </p>
  <code><pre>
  mything=/home/niclas/myplace/mything
  myplace=/home/niclas/myplace
  </pre></code>
  
  @param stream      the InputStream of the property file to read.
  @param mappings    Properties that will be available for translations initially.
  @param closeStream true if the method should close the stream before returning, false otherwise.
  
  @return the resolved properties.
  
  @throws IOException if an io error occurs