diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/Ino.java b/src/main/java/cokr/xit/fims/crdn/parsing/Ino.java index da408447..eda8a90c 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/Ino.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/Ino.java @@ -7,6 +7,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.regex.Matcher; +import java.util.stream.Collectors; import java.util.stream.Stream; import org.apache.commons.io.FilenameUtils; @@ -20,7 +21,12 @@ public class Ino implements EquipmentEnterprise { List dataObjectList = new ArrayList<>(); - fileList.forEach(item -> { + //파일명으로 정렬(파싱 전) + List sortedFileList = fileList + .sorted((item1, item2) -> item1.toFile().getName().compareTo(item2.toFile().getName())) + .collect(Collectors.toList()); + + sortedFileList.forEach(item -> { DataObject dataObject = new DataObject(); File file = item.toFile(); String filePath = file.getPath(); diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/XitRecommend.java b/src/main/java/cokr/xit/fims/crdn/parsing/XitRecommend.java index ce78f326..e555b50b 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/XitRecommend.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/XitRecommend.java @@ -1,7 +1,10 @@ package cokr.xit.fims.crdn.parsing; +import java.io.File; import java.nio.file.Path; +import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; import java.util.stream.Stream; import cokr.xit.foundation.data.DataObject; @@ -11,9 +14,28 @@ public class XitRecommend implements EquipmentEnterprise{ @Override public List parsing(Stream fileList) { + //파일명으로 정렬(파싱 전) + List sortedFileList = fileList + .sorted((item1, item2) -> item1.toFile().getName().compareTo(item2.toFile().getName())) + .collect(Collectors.toList()); - //TODO: + List dataObjectList = new ArrayList<>(); + sortedFileList.forEach(item -> { + DataObject dataObject = new DataObject(); + File file = item.toFile(); + String filePath = file.getPath(); + dataObject.put("FILE_PATH", filePath); + String fileName = file.getName(); + dataObject.put("FILE_NAME", fileName); + + //TODO: + + + dataObjectList.add(dataObject); + }); + + return dataObjectList; /* 1. 연계형식: 파일 연계 @@ -56,7 +78,6 @@ public class XitRecommend implements EquipmentEnterprise{ 127.482432 37.362931 */ - return null; } }