소스 정리

main
이범준 1 year ago
parent 658fcebaba
commit 32c458439d

@ -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<DataObject> dataObjectList = new ArrayList<>();
fileList.forEach(item -> {
//파일명으로 정렬(파싱 전)
List<Path> 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();

@ -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,10 +14,29 @@ public class XitRecommend implements EquipmentEnterprise{
@Override
public List<DataObject> parsing(Stream<Path> fileList) {
//파일명으로 정렬(파싱 전)
List<Path> sortedFileList = fileList
.sorted((item1, item2) -> item1.toFile().getName().compareTo(item2.toFile().getName()))
.collect(Collectors.toList());
List<DataObject> 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;
}
}

Loading…
Cancel
Save