blob: f22c23c77c5bd2ce694b1d6c709807e186b1d339 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
import groovy.json.JsonOutput
import org.apache.commons.io.FileUtils
class DataConfig implements Serializable {
String root = '.'
String server_id = ''
String match_prefix = '(.*)'
Boolean managed = true
Boolean keep_data = false
int keep_builds = 20
int keep_days = 10
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)
}
}
|