From 4b0cee80b4c4709122f3c7a78d50b52ade0b37ec Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Thu, 11 Apr 2024 14:21:15 +0900 Subject: [PATCH] =?UTF-8?q?=EC=86=8C=EB=82=98=ED=81=90=EB=B8=8C=20?= =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cokr/xit/fims/base/AdminController.java | 2 +- src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java | 4 +++- src/main/java/cokr/xit/fims/cmmn/web/StngController.java | 4 +++- .../java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java | 4 +++- src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java | 4 +++- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/cokr/xit/fims/base/AdminController.java b/src/main/java/cokr/xit/fims/base/AdminController.java index d7d3e700..f1e655c1 100644 --- a/src/main/java/cokr/xit/fims/base/AdminController.java +++ b/src/main/java/cokr/xit/fims/base/AdminController.java @@ -86,7 +86,7 @@ public class AdminController extends ApplicationController { case "smgReceive" : { if(interfaceKey == null || interfaceKey.equals("")) { - new RuntimeException("인터페이스키 없음"); + throw new RuntimeException("인터페이스키 없음"); } List interfaceKeys = new ArrayList(); diff --git a/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java b/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java index 9647f525..d0b34177 100644 --- a/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java +++ b/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java @@ -187,7 +187,9 @@ public class CmmnUtil { if(removeSelf) { if (file.listFiles().length==0) { - file.delete(); + if(!file.delete()) { + throw new RuntimeException("파일 삭제 중 오류가 발생하였습니다."); + } delCnt++; } } diff --git a/src/main/java/cokr/xit/fims/cmmn/web/StngController.java b/src/main/java/cokr/xit/fims/cmmn/web/StngController.java index 2e73e24c..39507dd9 100644 --- a/src/main/java/cokr/xit/fims/cmmn/web/StngController.java +++ b/src/main/java/cokr/xit/fims/cmmn/web/StngController.java @@ -160,7 +160,9 @@ public class StngController extends ApplicationController { String bgFullPath = bgPath + "/" + fileName; File newFile = new File(bgFullPath); if(newFile.exists()) { - newFile.delete(); + if(!newFile.delete()) { + throw new RuntimeException("배경 이미지 업로드 중 오류가 발생하였습니다."); + } } backgroundFile.transferTo(newFile); diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java index 98cb8c35..3e178d15 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java @@ -531,7 +531,9 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService zipFile.close(); for(File file : fileList) { - file.delete(); + if(!file.delete()) { + throw new RuntimeException("[F]파일 삭제 중 오류가 발생하였습니다."); + } } Crdn crdn = new Crdn(); diff --git a/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java b/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java index 227975da..223bb42f 100644 --- a/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java +++ b/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java @@ -182,7 +182,9 @@ public class Mngt03Controller extends ApplicationController { File newFile = new File(newFileFullPath); if(newFile.exists()) { - newFile.delete(); + if(!newFile.delete()) { + throw new RuntimeException("[F]배경 이미지 업로드 중 오류가 발생하였습니다."); + } } mf.transferTo(newFile);