chemilleX3
chemilleX3

Reputation: 1196

How to specify destination directory in Config.groovy?

I cant find an example that shows how to specify a directory in Config.groovy which will be called in any part of the application. The said directory will serve as a repository for the files that will be generated by the application.

Any help from you guys will be highly appreciated.

Upvotes: 0

Views: 251

Answers (1)

Gregg
Gregg

Reputation: 35864

If you have the following in Config.groovy:

my.app.location="/Some/Path"

You can access this via the injectable grailsApplication like so:

def SomeController {

  def grailsApplication

  def someAction() {
    def location = grailsApplication.config.my.app.location
  }
}

Same applies to Services, Taglibs, etc.

Upvotes: 1

Related Questions