Improved: Inline ‘EntityDataLoadContainer#getLoadFiles’

(OFBIZ-11070)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860063 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mathieu Lirzin
2019-05-26 12:35:13 +00:00
parent b71cd98911
commit 655f19c2fa
@@ -459,7 +459,7 @@ public class EntityDataLoadContainer implements Container {
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 implements Container {
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" */