| | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.iailab.framework.common.exception.enums.GlobalErrorCodeConstants.NOT_GENERAT; |
| | | import static com.iailab.framework.common.pojo.CommonResult.error; |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | | |
| | |
| | | try { |
| | | File jarFile = new File(mpkTenantBakFilePath + File.separator + MdkConstant.JAR + File.separator + dto.getPyName() + ".jar"); |
| | | if (!jarFile.exists()) { |
| | | throw new RuntimeException("jar包不存在,请先生成代码。jarPath:" + jarFile.getAbsolutePath()); |
| | | log.error("jar包不存在,请先生成代码。jarPath:" + jarFile.getAbsolutePath()); |
| | | return CommonResult.error(NOT_GENERAT.getCode(),NOT_GENERAT.getMsg()); |
| | | } |
| | | File dllFile = new File(mpkTenantBakFilePath + File.separator + MdkConstant.DLL + File.separator + dto.getPyName() + ".dll"); |
| | | if (!dllFile.exists()) { |
| | | throw new RuntimeException("dll文件不存在,请先生成代码。dllPath:" + dllFile.getAbsolutePath()); |
| | | log.error("dll文件不存在,请先生成代码。dllPath:" + dllFile.getAbsolutePath()); |
| | | return CommonResult.error(NOT_GENERAT.getCode(),NOT_GENERAT.getMsg()); |
| | | } |
| | | // 加载jar包 |
| | | classLoader = DllUtils.loadJar(jarFile.getAbsolutePath()); |
| | |
| | | DllUtils.unloadDll(classLoader); |
| | | DllUtils.unloadJar(classLoader); |
| | | } |
| | | System.gc(); |
| | | } |
| | | } |
| | | |