title: Gradle: Reading as a file works, but not as a resource
body: <p>I am able to read a file in my project resource as a plain file using the following line of code.</p>
  
  <pre><code>Properties props = new Properties()
  File propFile = new File("src/main/resources/application.properties")
  props.load(propFile.newDataInputStream())
  </code></pre>
  
  <p>But if I try to load the same using class loader in my gradle script i get null.</p>
  
  <pre><code>yaml.setResources(this.getClass().getClassLoader().getResource("application.yml"));
  </code></pre>
  
  <p>Does anybody faced this issue. and How can I solve this.</p>