title: How do I access Java resources in a Grails project?
body: <p>Grails newbie here. My application is in Grails, my IDE is IntelliJ IDEA. I configured my project (in IntelliJ) to say that my resources folder is under <code>root\src\resources</code>. I have an image file in there that I need to load into an InputStream / BufferedImage. However I can't seem to get to those resources from my Grails controller. This is what I was trying:</p>
  
  <pre><code>def image = this.getClass().getClassLoader().getResourceAsStream("image.png")
  </code></pre>
  
  <p>But that just returns <code>null</code>. I use this exact same convention in Java projects (well, except I have to declare image being of type InputStream), and it does work there. I was under the impression that I could essentially drop Java code in a Grails project and it should just work. What do I need to do differently to get this to work in my Grails controller? I need to access that static resource file.</p>