高级算法模块代码调整

This commit is contained in:
2023-08-18 10:04:52 +08:00
parent 4e55237f4c
commit bf11a9cd65

View File

@@ -1,6 +1,7 @@
package com.njcn.advance.utils; package com.njcn.advance.utils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.core.io.ClassPathResource;
import java.io.*; import java.io.*;
import java.net.URLDecoder; import java.net.URLDecoder;
@@ -27,7 +28,9 @@ public class JnaCallDllOrSo {
if(beginIndex == 0){ if(beginIndex == 0){
//linux操作系统 //linux操作系统
this.nameDll = "lib"+name+"_dll.so"; this.nameDll = "lib"+name+"_dll.so";
this.path = URLDecoder.decode(this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath(), "UTF-8"); ClassPathResource rtfPathResource = new ClassPathResource(nameDll);
this.path = rtfPathResource.getPath()+this.nameDll;
//this.path = URLDecoder.decode(this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath(), "UTF-8");
}else { }else {
this.nameDll = name+".dll"; this.nameDll = name+".dll";
this.path = URLDecoder.decode(this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath().replaceFirst("/", ""), "UTF-8"); this.path = URLDecoder.decode(this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath().replaceFirst("/", ""), "UTF-8");