diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/GardsSampleDataServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/GardsSampleDataServiceImpl.java index 71e490fc..b971b4a4 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/GardsSampleDataServiceImpl.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/GardsSampleDataServiceImpl.java @@ -39,6 +39,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.transaction.support.DefaultTransactionDefinition; +import java.io.File; import java.util.*; import java.util.stream.Collectors; @@ -173,6 +174,12 @@ public class GardsSampleDataServiceImpl extends ServiceImpl fails = new ArrayList<>(); for (String path : needDel) { + log.info("删除能谱文件:{}", path); + File file = new File(path); + if (file.isDirectory()) { + fails.add(path); + continue; + } boolean success = FileUtil.del(path); if (!success) fails.add(path); }