code: static public InputStream replaceEnv(InputStream source) throws IOException, SubstitutionException {
  	String template = streamToString(source);
  	String replaced = StringUtil.substituteWithEnvironment(template);
  	System.err.println(template);
  	System.err.println(replaced);
  	return new ByteArrayInputStream(replaced.getBytes());
      }
docs: Creates an InputStream containing the document resulting from replacing template
  parameters in the given InputStream source, using System.getenv as names/values.
  @param source The source stream
  @return An InputStream containing the resulting document.