It looks like the configuration option will be better than the environment variable. Config.groovy supports the environment, so you can specify different values ββfor development, production, etc.
environments { production { fileLocation = "D:/" } development { fileLocation "/somewhere/else" } test { fileLocation "/production/somewhere" } }
You can read the value of this parameter with:
def fileLocation = org.codehaus.groovy.grails.commons.ConfigurationHolder.config?.fileLocation
in grails 1.4 ConfigurationHolder deprecated, so you should read the configuration options instead:
def fileLocation = grailsApplication.config.fileLocation
source share