-
-
Save vmptk/9292f7dd9e2eb8a3e7ba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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