高级算法模块代码调整
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package com.njcn.advance.utils;
|
||||
|
||||
import cn.hutool.core.io.resource.ClassPathResource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.URLDecoder;
|
||||
@@ -28,8 +28,12 @@ public class JnaCallDllOrSo {
|
||||
if(beginIndex == 0){
|
||||
//linux操作系统
|
||||
this.nameDll = "lib"+name+"_dll.so";
|
||||
ClassPathResource rtfPathResource = new ClassPathResource(nameDll);
|
||||
this.path = rtfPathResource.getPath()+this.nameDll;
|
||||
|
||||
String resource = Thread.currentThread().getContextClassLoader().getResource(this.nameDll).getPath();
|
||||
log.info(resource);
|
||||
String path = new ClassPathResource(this.nameDll).getClassLoader().getResource(this.nameDll).getPath();
|
||||
log.info(path);
|
||||
this.path = path;
|
||||
//this.path = URLDecoder.decode(this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath(), "UTF-8");
|
||||
}else {
|
||||
this.nameDll = name+".dll";
|
||||
@@ -39,9 +43,9 @@ public class JnaCallDllOrSo {
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
/* if (JnaCallDllOrSo.jarPath.equals("")) {
|
||||
if (JnaCallDllOrSo.jarPath.equals("")) {
|
||||
JnaCallDllOrSo.jarPath = this.path.substring(0, this.path.lastIndexOf('/'));
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user