|
|
|
@ -7,10 +7,12 @@ import java.io.InputStream;
|
|
|
|
|
import java.nio.charset.Charset;
|
|
|
|
|
import java.nio.file.Files;
|
|
|
|
|
import java.nio.file.Path;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Base64;
|
|
|
|
|
import java.util.Base64.Decoder;
|
|
|
|
|
import java.util.Base64.Encoder;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import cokr.xit.base.file.FileInfo;
|
|
|
|
@ -36,6 +38,17 @@ public class SingleFileParser extends LayoutParser {
|
|
|
|
|
String fileName = file.getName();
|
|
|
|
|
dataObject.put("FILE_NAME", fileName);
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd / HH:mm:ss");
|
|
|
|
|
dataObject.put("FILE_LAST_MODIFIED", sdf.format(new Date(file.lastModified())));
|
|
|
|
|
dataObject.put("FILE_SIZE", file.length()+" byte");
|
|
|
|
|
|
|
|
|
|
dataObject.put("FILE_EXTENSION","");
|
|
|
|
|
|
|
|
|
|
boolean isUserUpload = file.compareTo(new File(descriptor.getLinkFileLocation()+File.separator+fileName)) == 0;
|
|
|
|
|
if(!isUserUpload) {
|
|
|
|
|
dataObject.put("LINK_ENT_NM", descriptor.getLinkEnterpriseName());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//파일내용
|
|
|
|
|
String fileCn0 = "";
|
|
|
|
|
try {
|
|
|
|
@ -78,7 +91,6 @@ public class SingleFileParser extends LayoutParser {
|
|
|
|
|
dataObject.put("TRAFFIC_LIGHT_TYPE", CmmnUtil.substringByBytes(fileCn, 113, 113)); //신호등종류(미사용)
|
|
|
|
|
dataObject.put("SOME", CmmnUtil.substringByBytes(fileCn, 113, 113)); //?(미사용)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String fileAreaText = fileCn0.substring(114);
|
|
|
|
|
|
|
|
|
|
Encoder encoder = Base64.getEncoder();
|
|
|
|
@ -127,7 +139,6 @@ public class SingleFileParser extends LayoutParser {
|
|
|
|
|
|
|
|
|
|
dataObject.put("TEMP_GROUP_ID", tempGroupSeq);
|
|
|
|
|
tempGroupSeq++;
|
|
|
|
|
dataObject.put("ENT_TYPE", "hitecom");
|
|
|
|
|
|
|
|
|
|
dataObjectList.add(dataObject);
|
|
|
|
|
});
|
|
|
|
|