From a5ad271a525cdd1d637a664bd0360848d229e440 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 8 Oct 2019 10:28:05 -0400 Subject: Refactor package structure --- src/DataConfig.groovy | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 src/DataConfig.groovy (limited to 'src/DataConfig.groovy') 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) - } -} -- cgit