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