Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to place resources in Grails project?

I am wondering if there is a designated place for resource files in a Grails application? I have a csv file that gets loaded into a map (nothing major) but didn't quite know where to put it in the project.

So my question is, is there a dedicated place in the project to place this file? (If so, where?) Or is it better to place it outside of the project?

like image 992
StartingGroovy Avatar asked May 20 '11 21:05

StartingGroovy


1 Answers

If the csv is going to need updating from time to time, I'd put it external to your grails folder, and point to it from config.groovy.

If it's basically a static file, I'd put it in src/java/resources, and load it with something like this.class.getResource("/resources/file.csv") as you would with a regular java app

like image 195
tim_yates Avatar answered Oct 02 '22 21:10

tim_yates