svn commit: r585645 - /ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r585645 - /ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java

doogie-3
Author: doogie
Date: Wed Oct 17 12:46:52 2007
New Revision: 585645

URL: http://svn.apache.org/viewvc?rev=585645&view=rev
Log:
Allow multiple files to be installed on the command line, by splitting
on comma.  Closes https://issues.apache.org/jira/browse/OFBIZ-1284

Modified:
    ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java

Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java?rev=585645&r1=585644&r2=585645&view=diff
==============================================================================
--- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java (original)
+++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java Wed Oct 17 12:46:52 2007
@@ -51,7 +51,7 @@
     protected String configFile = null;
     protected String readers = null;
     protected String directory = null;
-    protected String file = null;
+    protected ArrayList files = new ArrayList();
     protected String component = null;
     protected boolean useDummyFks = false;
     protected boolean maintainTxs = false;
@@ -124,7 +124,7 @@
                 } else if ("group".equalsIgnoreCase(argumentName)) {
                     this.overrideGroup = argumentVal;
                 } else if ("file".equalsIgnoreCase(argumentName)) {
-                    this.file = argumentVal;
+                    this.files.addAll(StringUtil.split(argumentVal, ","));
                 } else if ("dir".equalsIgnoreCase(argumentName)) {
                     this.directory = argumentVal;
                 } else if ("createfks".equalsIgnoreCase(argumentName)) {
@@ -148,7 +148,7 @@
                 }                
     
                 // special case
-                if (this.readers == null && (this.file != null || this.directory != null)) {
+                if (this.readers == null && (!this.files.isEmpty() || this.directory != null)) {
                     this.readers = "none";
                 }
             }
@@ -214,9 +214,10 @@
             urlList = new ArrayList();
         }
 
-        // add in the defined extra file
-        if (this.file != null) {
-            URL fileUrl = UtilURL.fromResource(this.file);
+        // add in the defined extra files
+        Iterator it = this.files.iterator();
+        while (it.hasNext()) {
+            URL fileUrl = UtilURL.fromResource((String) it.next());
             if (fileUrl != null) {
                 urlList.add(fileUrl);
             }