title: Get Spring Environment as Properties
body: <p>I wonder if there is a way to extract properties from Spring Environment (e.g. obtained from ApplicationContext) in the form of Properties instance? Or, at least, is there a way to enumerate the properties in Spring Environment, or get them all as a map, or any other way I can turn a [initially unknown] set of properties into a Properties object?</p>
  
  <p>I need this in order to create a jclouds <code>Context</code> by calling <code>org.jclouds.ContextBuilder.newBuilder()</code> and <code>.overrides(Properties)</code>. The idea is to configure the actual cloud provider solely by means of .properties file, and I don't want to couple application logic with provider-specific properties.</p>
  
  <p><strong>[UPDATE]</strong></p>
  
  <p>The .properties files to be used are configured using <code>&lt;context:property-placeholder&gt;</code>, and it actually specifies a list of paths, like this:</p>
  
  <pre><code>&lt; context:property-placeholder location=
      "classpath:/jdbc.properties,
      file:${jboss.server.config.dir}/jdbc.properties,
      file:${catalina.home}/conf/jdbc.properties"
      ignore-resource-not-found="true"/&gt;
  </code></pre>
  
  <p>which suggests that the .properties file is searched in the mentioned list of locations in order. I would like to achieve the following:</p>
  
  <ul>
  <li>keep the list of .properties files and their possible locations in this XML definition file only;</li>
  <li>allow to place jclouds related properties in <em>any</em> of the .properties files mentioned in the XML;</li>
  <li>access the properties, resolved and loaded by Spring, in the form of Properties object so I am able to feed that to jclouds <code>ContextBuilder</code>.</li>
  </ul>
  
  <p>Please let me know if all of this is feasible. Thank you in advance!</p>
  
  <p>-Vlad</p>