파일압축 라이브러리 제거

main
이범준 7 months ago
parent c471ff80df
commit 31b442e563

@ -150,14 +150,6 @@
<version>0.5</version> <version>0.5</version>
</dependency> </dependency>
<!-- 파일압축 라이브러리 -->
<dependency>
<groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId>
<version>2.11.5</version>
</dependency>
<!-- 바코드 관련 --> <!-- 바코드 관련 -->
<dependency> <dependency>
<groupId>com.google.zxing</groupId> <groupId>com.google.zxing</groupId>

@ -18,10 +18,10 @@ import java.util.Map;
import org.egovframe.rte.fdl.string.EgovStringUtil; import org.egovframe.rte.fdl.string.EgovStringUtil;
import cokr.xit.base.file.ZIP;
import cokr.xit.foundation.Downloadable; import cokr.xit.foundation.Downloadable;
import cokr.xit.foundation.data.DataFormat; import cokr.xit.foundation.data.DataFormat;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
import net.lingala.zip4j.ZipFile;
public class OutsourcingFileMaker { public class OutsourcingFileMaker {
protected String printKorName; protected String printKorName;
@ -240,10 +240,8 @@ public class OutsourcingFileMaker {
String zipFileName = yyyymmdd + printKorName + ".zip"; String zipFileName = yyyymmdd + printKorName + ".zip";
String zipFilePath = outsourcingResultPath + File.separator + zipFileName; String zipFilePath = outsourcingResultPath + File.separator + zipFileName;
ZipFile zipFile = new ZipFile(zipFilePath); ZIP zip = new ZIP();
zipFile.addFile(new File(metaFilePath)); zip.compress(zipFilePath, metaFilePath, imagesFolderPath);
zipFile.addFolder(new File(imagesFolderPath));
zipFile.close();
metaFile.delete(); metaFile.delete();
File[] images = imagesFolderPathFile.listFiles(); File[] images = imagesFolderPathFile.listFiles();

@ -15,6 +15,7 @@ import org.springframework.stereotype.Service;
import cokr.xit.base.code.CommonCode; import cokr.xit.base.code.CommonCode;
import cokr.xit.base.code.service.bean.CodeBean; import cokr.xit.base.code.service.bean.CodeBean;
import cokr.xit.base.file.FileInfo; import cokr.xit.base.file.FileInfo;
import cokr.xit.base.file.ZIP;
import cokr.xit.base.file.service.FileQuery; import cokr.xit.base.file.service.FileQuery;
import cokr.xit.base.file.service.bean.FileBean; import cokr.xit.base.file.service.bean.FileBean;
import cokr.xit.fims.cmmn.CmmnQuery; import cokr.xit.fims.cmmn.CmmnQuery;
@ -42,7 +43,7 @@ import cokr.xit.fims.sprt.dao.TotalInfoMapper;
import cokr.xit.fims.sprt.service.bean.MediaBean; import cokr.xit.fims.sprt.service.bean.MediaBean;
import cokr.xit.foundation.component.AbstractServiceBean; import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
import net.lingala.zip4j.ZipFile; import cokr.xit.interfaces.filejob.JobConf;
@Service("crdnService") @Service("crdnService")
public class CrdnServiceBean extends AbstractServiceBean implements CrdnService { public class CrdnServiceBean extends AbstractServiceBean implements CrdnService {
@ -516,7 +517,6 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService
} }
String zipFilePath = workPath + "/" + linkFileMaker.getZipFileName(); String zipFilePath = workPath + "/" + linkFileMaker.getZipFileName();
ZipFile zipFile = new ZipFile(zipFilePath);
File[] fileList = workFolder.listFiles(new FilenameFilter() { File[] fileList = workFolder.listFiles(new FilenameFilter() {
@Override @Override
@ -524,11 +524,13 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService
return !(name.toUpperCase().endsWith(".ZIP")); return !(name.toUpperCase().endsWith(".ZIP"));
} }
}); });
for(File file : fileList) { String[] fileNameList = new String[fileList.length];
zipFile.addFile(file); for(int i=0; i<fileList.length; i++) {
fileNameList[i] = fileList[i].getPath();
} }
zipFile.close(); ZIP zip = new ZIP();
zip.compress(zipFilePath, fileNameList);
for(File file : fileList) { for(File file : fileList) {
if(!file.delete()) { if(!file.delete()) {
@ -536,6 +538,15 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService
} }
} }
String ESB_Folder_Path = JobConf.get().getDir("send")+"/"+JobConf.get().getDirCode("lntris");
if(!new File(ESB_Folder_Path).exists()) {
new File(ESB_Folder_Path).mkdirs();
}
File src = new File(zipFilePath);
File dst = new File(ESB_Folder_Path+"/"+linkFileMaker.getZipFileName());
src.renameTo(dst);
Crdn crdn = new Crdn(); Crdn crdn = new Crdn();
crdn.setCrdnId(crdnID); crdn.setCrdnId(crdnID);
crdn.setModifiedBy(currentUser().getId()); crdn.setModifiedBy(currentUser().getId());

Loading…
Cancel
Save