svn commit: r1860063 - /ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/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: r1860063 - /ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java

mthl
Author: mthl
Date: Sun May 26 12:35:13 2019
New Revision: 1860063

URL: http://svn.apache.org/viewvc?rev=1860063&view=rev
Log:
Improved: Inline ‘EntityDataLoadContainer#getLoadFiles’
(OFBIZ-11070)

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

Modified: ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java?rev=1860063&r1=1860062&r2=1860063&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java Sun May 26 12:35:13 2019
@@ -459,7 +459,7 @@ public class EntityDataLoadContainer imp
         List<URL> urlList = new ArrayList<>();
 
         // prepare command line properties passed by user
-        List<String> files = getLoadFiles(loadDataProps.get(DATA_FILE));
+        List<String> files = Arrays.asList(loadDataProps.getOrDefault(DATA_FILE, "").split(","));
         String directory = loadDataProps.get(DATA_DIR);
         String component = loadDataProps.get(DATA_COMPONENT);
         String readers = loadDataProps.get(DATA_READERS);
@@ -493,13 +493,6 @@ public class EntityDataLoadContainer imp
         return urlList;
     }
 
-    private List<String> getLoadFiles(String fileProp) {
-        List<String> fileList = new ArrayList<>();
-        Optional.ofNullable(fileProp)
-                .ifPresent(props -> fileList.addAll(StringUtil.split(props, ",")));
-        return fileList;
-    }
-
     private static boolean isDataReadersEnabled(List<String> files, String directory, String readers) {
         /* if files or directories are passed by the user and no readers are
          * passed then set readers to "none" */