title: Spring expression to evaluate OS
body: <p>I want to evaluate the OS (operating system) system property to load the environment corresponding configuration file. E.g. if OS evaluates to Windows, the <code>properties-win.xml</code> will be loaded <em>or</em> if OS evaluates to Unix or Linux, the <code>properties-unix.xml</code> will be loaded.</p>
  
  <p>The below spel works fine</p>
  
  <pre><code>#{(systemProperties['os.name'].indexOf('nix') &gt;= 0 or systemProperties['os.name'].indexOf('nux') &gt;= 0 or systemProperties['os.name'].indexOf('aix') &gt; 0 ) ? 'linux' : 
          ((systemProperties['os.name'].indexOf('Win') &gt;= 0) ? 'windows' : 'Unknow OS')}
  </code></pre>
  
  <p>But in place of evaluating the <code>systemProperties['os.name']</code> each time, I want to have this in a variable and then wants to match the condition.
  I saw the <code>#this</code> variable usage (<a href="http://docs.spring.io/spring-framework/docs/3.0.6.RELEASE/spring-framework-reference/html/expressions.html" rel="nofollow">http://docs.spring.io/spring-framework/docs/3.0.6.RELEASE/spring-framework-reference/html/expressions.html</a> sec 6.5.10.1) and tried to make the below spel</p>
  
  <pre><code>#{systemProperties['os.name'].?((#this.indexOf('nix') &gt;= 0 or #this.indexOf('nux') &gt;= 0 or #this.indexOf('aix') &gt; 0 ) ? 'unix' : 
      (#this.indexOf('win') &gt;= 0) ? 'windows' : 'Unknown')}
  </code></pre>
  
  <p>But somehow, it's giving parsing exception.</p>
  
  <p>Does anyone can suggest anything?</p>