| | |
| | | package com.ruoyi.device.dhsdk.lib;
|
| | |
|
| | | import com.ruoyi.device.dhsdk.lib.DynamicParseUtil;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.xml.sax.SAXException;
|
| | |
|
| | | import javax.xml.parsers.ParserConfigurationException;
|
| | |
| | | * @description 动态库加载
|
| | | * @date 2020/11/14
|
| | | */
|
| | | @Slf4j(topic = "dhSdk")
|
| | | public class LibraryLoad {
|
| | | private static final String ARCH_WINDOWS = "win";
|
| | | private static final String ARCH_LINUX = "linux";
|
| | |
| | | if (!(EXTRACT_PATH.endsWith("/") || EXTRACT_PATH.endsWith("\\"))) {
|
| | | path = EXTRACT_PATH + "/";
|
| | | }
|
| | | System.out.println("load library: " + path + fullName);
|
| | | log.debug("load library: " + path + fullName);
|
| | | return path + fullName;
|
| | | }
|
| | |
|
| | |
| | | writer.close();
|
| | | in.close();
|
| | | } catch (Exception e) {
|
| | | System.out.println("dynamic file[ " + fileName + " ] not found in project.please ensure you need this library.");
|
| | | log.error("dynamic file[ " + fileName + " ] not found in project.please ensure you need this library.");
|
| | | }
|
| | | return extractedLibFile != null ? extractedLibFile.getAbsolutePath() : "";
|
| | | }
|