title: How to read properties file in web application?
body: <p>Properties file location is <code>WEB-INF/classes/auth.properties</code>.</p>
  
  <p>I cannot use JSF-specific ways (with ExternalContext) because I need properties file in a service module which doesn't have a dependency on a web-module.</p>
  
  <p>I've already tried</p>
  
  <pre><code>MyService.class.getClassLoader().getResourceAsStream("/WEB-INF/classes/auth.properties");
  </code></pre>
  
  <p>but it returns <code>null</code>.</p>
  
  <p>I've also tried to read it with <code>FileInputStream</code> but it requires the full path what is unacceptable.</p>
  
  <p>Any ideas?</p>