blob: bc19ae2a930307ef3d7543db57a0ae192f79e419 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package DataConfig;
import groovy.json.JsonOutput
import org.apache.commons.io.FileUtils
class DataConfig implements Serializable {
String root = '.'
String server_id = ''
String match_prefix = '(.*)'
def data = [:]
DataConfig() {}
def insert(String name, String block) {
/* Store JSON directly as string */
this.data[name] = block
}
def insert(String name, block=[:]) {
/* Convert a Groovy Map to JSON and store it */
this.data[name] = JsonOutput.toJson(block)
}
}
|