polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [23/35] zest-java git commit: fileconfig: introduce convention helper
Date Sat, 19 Nov 2016 22:50:24 GMT
fileconfig: introduce convention helper


Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/5018cf53
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/5018cf53
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/5018cf53

Branch: refs/heads/develop
Commit: 5018cf53c86fe270031ed7eb629f102b1a9f0a47
Parents: 7524f12
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Sat Nov 19 16:20:06 2016 +0100
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Sat Nov 19 16:20:06 2016 +0100

----------------------------------------------------------------------
 .../fileconfig/FileConfigurationOverride.java   | 39 +++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-java/blob/5018cf53/libraries/fileconfig/src/main/java/org/apache/zest/library/fileconfig/FileConfigurationOverride.java
----------------------------------------------------------------------
diff --git a/libraries/fileconfig/src/main/java/org/apache/zest/library/fileconfig/FileConfigurationOverride.java
b/libraries/fileconfig/src/main/java/org/apache/zest/library/fileconfig/FileConfigurationOverride.java
index cef0793..911ba75 100644
--- a/libraries/fileconfig/src/main/java/org/apache/zest/library/fileconfig/FileConfigurationOverride.java
+++ b/libraries/fileconfig/src/main/java/org/apache/zest/library/fileconfig/FileConfigurationOverride.java
@@ -21,8 +21,31 @@ package org.apache.zest.library.fileconfig;
 
 import java.io.File;
 
+/**
+ * Assembly time FileConfiguration override.
+ */
 public final class FileConfigurationOverride
 {
+    /**
+     * {@literal configuration}.
+     */
+    public static final String CONVENTIONAL_CONFIGURATION = "configuration";
+    /**
+     * {@literal data}.
+     */
+    public static final String CONVENTIONAL_DATA = "data";
+    /**
+     * {@literal temporary}.
+     */
+    public static final String CONVENTIONAL_TEMPORARY = "temporary";
+    /**
+     * {@literal cache}.
+     */
+    public static final String CONVENTIONAL_CACHE = "cache";
+    /**
+     * {@literal log}.
+     */
+    public static final String CONVENTIONAL_LOG = "log";
 
     private File configuration;
     private File data;
@@ -30,6 +53,21 @@ public final class FileConfigurationOverride
     private File cache;
     private File log;
 
+    /**
+     * With all directories under the given root using conventional names.
+     * @param root Root file
+     * @return This
+     */
+    public FileConfigurationOverride withConventionalRoot( File root )
+    {
+        this.configuration = new File( root, CONVENTIONAL_CONFIGURATION );
+        this.data = new File( root, CONVENTIONAL_DATA );
+        this.temporary = new File( root, CONVENTIONAL_TEMPORARY );
+        this.cache = new File( root, CONVENTIONAL_CACHE );
+        this.log = new File( root, CONVENTIONAL_LOG );
+        return this;
+    }
+
     public FileConfigurationOverride withConfiguration( File configuration )
     {
         this.configuration = configuration;
@@ -84,5 +122,4 @@ public final class FileConfigurationOverride
     {
         return temporary;
     }
-
 }


Mime
View raw message