Skip to content

Instantly share code, notes, and snippets.

@vmptk
Forked from keyle/HDD.groovy
Last active August 29, 2015 14:24
Show Gist options
  • Save vmptk/9292f7dd9e2eb8a3e7ba to your computer and use it in GitHub Desktop.
Save vmptk/9292f7dd9e2eb8a3e7ba to your computer and use it in GitHub Desktop.
package utils
import groovy.json.JsonBuilder
import groovy.json.JsonSlurper
class HDD {
static save(Object content, String filePath) {
new File(filePath).write(new JsonBuilder(content).toPrettyString())
}
static Object load(String filePath) {
return new JsonSlurper().parseText(new File(filePath).text)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment