title: Read property file under classpath using scala
body: <p>I am trying to read a property file from classpath using scala. But it looks like it won't work, it is different from java. The following 2 code snippet, one is java (working), another is scala (not working). I don't understand what is the difference.</p>
  
  <pre><code>// working
  BufferedReader reader = new BufferedReader(new InputStreamReader(
  Test.class.getResourceAsStream("conf/fp.properties")));
  
  // not working 
  val reader = new BufferedReader(new InputStreamReader(
  getClass.getResourceAsStream("conf/fp.properties")));
  
  Exception in thread "main" java.lang.NullPointerException
  at java.io.Reader.&lt;init&gt;(Reader.java:78)
  at java.io.InputStreamReader.&lt;init&gt;(InputStreamReader.java:72)
  at com.ebay.searchscience.searchmetrics.fp.conf.FPConf$.main(FPConf.scala:31)
  at com.ebay.searchscience.searchmetrics.fp.conf.FPConf.main(FPConf.scala)
  </code></pre>