提交 ede7e255 authored 作者: wangqiang's avatar wangqiang

dll

上级 ef939f38
...@@ -67,8 +67,7 @@ public interface IHwPortController extends Library { ...@@ -67,8 +67,7 @@ public interface IHwPortController extends Library {
*/ */
//如果本地类库不是线程安全的,可用Native.synchronizedLibrary //如果本地类库不是线程安全的,可用Native.synchronizedLibrary
//IHwPortController instanceDll = (IHwPortController) Native.loadLibrary(ParseUrlUtil.parseAbsolutePath("/dact/Release/HwPortController.dll", System.getProperty("user.dir") + "\\HwPortController.dll"), IHwPortController.class); IHwPortController instanceDll = (IHwPortController) Native.loadLibrary(ParseUrlUtil.parseAbsolutePath("/dact/Release/HwPortController.dll", "D:\\\\work\\\\priusis\\\\priusis-iot\\\\apq-iot\\\\apq-client\\\\apq-pc-control\\\\src\\\\main\\\\resources\\\\dact\\\\Release\\\\HwPortController.dll"), IHwPortController.class);
IHwPortController instanceDll = (IHwPortController) Native.loadLibrary("D:\\work\\priusis\\priusis-iot\\apq-iot\\apq-client\\apq-pc-control\\src\\main\\resources\\dact\\Release\\HwPortController.dll", IHwPortController.class);
/** /**
* 初始化硬件接口管理模块 * 初始化硬件接口管理模块
......
...@@ -13,14 +13,14 @@ public class ParseUrlUtil { ...@@ -13,14 +13,14 @@ public class ParseUrlUtil {
String path = defaultPath; String path = defaultPath;
if (Platform.isWindows()) { if (Platform.isWindows()) {
path = IHwPortController.class.getResource(relatePath).getPath();
if (path.contains("BOOT-INF")) {
path = System.getProperty("user.dir") + "/" + relatePath;
}
path = path.replaceFirst("/", "");//排除中文空格
path = path.replaceAll("%20", " ");//排除中文空格
path = path.replaceAll("/", "\\\\");//排除中文空格
try { try {
path = IHwPortController.class.getResource(relatePath).getPath();
if (path.contains("BOOT-INF")) {
path = System.getProperty("user.dir") + "/" + relatePath;
}
path = path.replaceFirst("/", "");//排除中文空格
path = path.replaceAll("%20", " ");//排除中文空格
path = path.replaceAll("/", "\\\\");//排除中文空格
path = java.net.URLDecoder.decode(path, "utf-8"); //解决路径包含中文的情况 path = java.net.URLDecoder.decode(path, "utf-8"); //解决路径包含中文的情况
log.info("解析到PATH为:{}", path); log.info("解析到PATH为:{}", path);
} catch (Exception e) { } catch (Exception e) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论