Search code examples
jsongrailsjsonslurper

Grails 1.3.9 parse JSON file


I am working on a project with Grails 1.3.9 and I need to parse a JSON file and read some values. This can be easily done with JsonSlurper but it is supported only for Grails 1.8 and higher. Are there any other techniques to achieve this?


Solution

  • Got it

    def parsedJSON = JSON.parse(new FileInputStream(file), "UTF-8")