You can do this with code that looks something like:
def exportService // << inject export service
def exportCsv() {
File exportOutput = new File("/tmp/newTempFile.csv")
def exportOutputStream = new FileOutputStream(exportOutput)
exportService.export("csv", exportOutputStream, Author.getAll(), [:],
[:] )
}
Hope this helps,
Nathan Wells