aboutsummaryrefslogtreecommitdiff
path: root/src/DataConfig.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'src/DataConfig.groovy')
-rw-r--r--src/DataConfig.groovy40
1 files changed, 0 insertions, 40 deletions
diff --git a/src/DataConfig.groovy b/src/DataConfig.groovy
deleted file mode 100644
index 37adf88..0000000
--- a/src/DataConfig.groovy
+++ /dev/null
@@ -1,40 +0,0 @@
-import groovy.json.JsonOutput
-import org.apache.commons.io.FileUtils
-
-class DataConfig implements Serializable {
- String root = '.'
- String server_id = ''
- String match_prefix = '(.*)'
- String direction
- Boolean managed = true
- Boolean keep_data = false
- int keep_builds = 20
- int keep_days = 10
- def data = [:]
-
- DataConfig(String direction = "upload") {
- this.direction = direction.toLowerCase()
- //if (!this.isUpload() && !this.isDownload()) {
- // throw new Exception("DataConfig.direction argument must be 'upload'"
- // + "or 'download' (got: ${this.direction})")
- //}
- }
-
- def isUpload() {
- return this.direction.startsWith('u')
- }
-
- def isDownload() {
- return this.direction.startswith('d')
- }
-
- 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)
- }
-}