title: Where to put a text file in Grails, and how to get the path
body: <p>I need to read in a .txt file into a groovy class in order to interrogate it line by line.  But I am not sure what folder I put it into in my grails app, and how to get the path to it?</p>
  
  <p>So far I have tried placing it under <code>src</code> and also in a new folder <code>web-app/txt</code></p>
  
  <p>and I have tried the the following to read it in</p>
  
  <pre><code>fileIn = new File('/lexicon.txt').text 
  </code></pre>
  
  <p>and </p>
  
  <pre><code>fileIn = new File('txt/lexicon.txt').text
  </code></pre>
  
  <p>to no avail.</p>
  
  <p>Any body have any pointers?</p>