提交 0fa08e0e authored 作者: wangqiang's avatar wangqiang

controll

上级 ede7e255
...@@ -194,7 +194,7 @@ public class PersistentFileServiceImpl implements PersistentFileService { ...@@ -194,7 +194,7 @@ public class PersistentFileServiceImpl implements PersistentFileService {
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
} catch (IOException e) { } catch (IOException e) {
log.error(e.getMessage(), e); log.error(e.getMessage());
throw e; throw e;
} finally { } finally {
try { try {
......
...@@ -83,5 +83,14 @@ ...@@ -83,5 +83,14 @@
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>dact/**</exclude>
</excludes>
</resource>
</resources>
</build> </build>
</project> </project>
\ No newline at end of file
...@@ -67,7 +67,7 @@ public interface IHwPortController extends Library { ...@@ -67,7 +67,7 @@ public interface IHwPortController extends Library {
*/ */
//如果本地类库不是线程安全的,可用Native.synchronizedLibrary //如果本地类库不是线程安全的,可用Native.synchronizedLibrary
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(ParseUrlUtil.parseAbsolutePath("/dact/Release/HwPortController.dll", System.getProperty("user.dir") + "\\HwPortController.dll"), IHwPortController.class);
/** /**
* 初始化硬件接口管理模块 * 初始化硬件接口管理模块
......
...@@ -3,6 +3,9 @@ package com.priusis.utils; ...@@ -3,6 +3,9 @@ package com.priusis.utils;
import com.sun.jna.Platform; import com.sun.jna.Platform;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.io.File;
import java.io.UnsupportedEncodingException;
@Slf4j @Slf4j
public class ParseUrlUtil { public class ParseUrlUtil {
/** /**
...@@ -18,15 +21,22 @@ public class ParseUrlUtil { ...@@ -18,15 +21,22 @@ public class ParseUrlUtil {
if (path.contains("BOOT-INF")) { if (path.contains("BOOT-INF")) {
path = System.getProperty("user.dir") + "/" + relatePath; path = System.getProperty("user.dir") + "/" + relatePath;
} }
} catch (Exception e) {
log.error("usr decode", e);
path = System.getProperty("user.dir") + "/" + relatePath;
if (!new File(path).exists()) {
path = defaultPath;
}
}
path = path.replaceFirst("/", "");//排除中文空格 path = path.replaceFirst("/", "");//排除中文空格
path = path.replaceAll("%20", " ");//排除中文空格 path = path.replaceAll("%20", " ");//排除中文空格
path = path.replaceAll("/", "\\\\");//排除中文空格 path = path.replaceAll("/", "\\\\");//排除中文空格
try {
path = java.net.URLDecoder.decode(path, "utf-8"); //解决路径包含中文的情况 path = java.net.URLDecoder.decode(path, "utf-8"); //解决路径包含中文的情况
log.info("解析到PATH为:{}", path); } catch (UnsupportedEncodingException e) {
} catch (Exception e) { log.error("UnsupportedEncoding", e);
log.error("usr decode", e);
path = defaultPath;
} }
log.info("解析到PATH为:{}", path);
} }
//if (Platform.isLinux()) { //if (Platform.isLinux()) {
// try { // try {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论