用户密码正则表达式bug

This commit is contained in:
2023-08-21 14:06:56 +08:00
parent ca3ec2d82f
commit 5c1eaec013
2 changed files with 57 additions and 58 deletions

View File

@@ -31,17 +31,20 @@ public class JnaCallDllOrSo {
//linux操作系统 //linux操作系统
this.nameDll = "lib" + name + "_dll"; this.nameDll = "lib" + name + "_dll";
suffix = ".so"; suffix = ".so";
// this.path = "/usr/local/jarfiles/advanceboot/BOOT-INF/classes/";
//this.path = URLDecoder.decode(this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath(), "UTF-8");
} else { } else {
this.nameDll = name; this.nameDll = name;
// this.path = URLDecoder.decode(this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath().replaceFirst("/", ""), "UTF-8");
} }
File tempFile; File dockerFile = new File("/usr/local/dllFile/".concat(this.nameDll.concat(suffix)));
if(dockerFile.exists()){
this.path = dockerFile.getAbsolutePath();
}else {
dockerFile.mkdirs();
dockerFile.createNewFile();
}
try (InputStream inputStream = getClass().getClassLoader().getResourceAsStream(this.nameDll.concat(suffix))) { try (InputStream inputStream = getClass().getClassLoader().getResourceAsStream(this.nameDll.concat(suffix))) {
tempFile = File.createTempFile(this.nameDll, suffix); try (FileOutputStream outputStream = new FileOutputStream(dockerFile)) {
try (FileOutputStream outputStream = new FileOutputStream(tempFile)) {
byte[] buffer = new byte[1024]; byte[] buffer = new byte[1024];
int bytesRead; int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) { while ((bytesRead = inputStream.read(buffer)) != -1) {
@@ -49,9 +52,7 @@ public class JnaCallDllOrSo {
} }
} }
} }
this.path = tempFile.getAbsolutePath(); this.path = dockerFile.getAbsolutePath();
System.out.println(1);
System.out.println(1);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); log.error(e.getMessage());
} }
@@ -62,8 +63,6 @@ public class JnaCallDllOrSo {
public String getStrpath() { public String getStrpath() {
return this.path; return this.path;
// String aa = this.path + this.nameDll;
// return aa.replace("/", File.separator);
} }
public void setPath() { public void setPath() {

View File

@@ -1,47 +1,47 @@
package com.njcn.influx; //package com.njcn.influx;
//
import com.njcn.influx.imapper.CldStatisticsFlowMapper; //import com.njcn.influx.imapper.CldStatisticsFlowMapper;
import com.njcn.influx.pojo.dto.StatisticalDataDTO; //import com.njcn.influx.pojo.dto.StatisticalDataDTO;
import com.njcn.influx.pojo.po.DataV; //import com.njcn.influx.pojo.po.DataV;
import com.njcn.influx.service.CommonService; //import com.njcn.influx.service.CommonService;
import com.njcn.influx.service.DataFlickerService; //import com.njcn.influx.service.DataFlickerService;
import com.njcn.influx.service.IDataVService; //import com.njcn.influx.service.IDataVService;
import lombok.SneakyThrows; //import lombok.SneakyThrows;
import org.junit.Test; //import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
//
import java.util.List; //import java.util.List;
//
/** ///**
* @author hongawen // * @author hongawen
* @version 1.0.0 // * @version 1.0.0
* @date 2021年12月14日 12:55 // * @date 2021年12月14日 12:55
*/ // */
public class DemoTest extends BaseJunitTest { //public class DemoTest extends BaseJunitTest {
//
@Autowired // @Autowired
private CldStatisticsFlowMapper cldStatisticsFlowMapper; // private CldStatisticsFlowMapper cldStatisticsFlowMapper;
//
@Autowired // @Autowired
private DataFlickerService dataFlickerService; // private DataFlickerService dataFlickerService;
//
@Autowired // @Autowired
private IDataVService dataVService; // private IDataVService dataVService;
//
@Autowired // @Autowired
private CommonService commonService; // private CommonService commonService;
//
@SneakyThrows // @SneakyThrows
@Test // @Test
public void test() { // public void test() {
// dataFlickerService.getDataFlicker("ff2d9674c1f1ecce7f33a5bf17fc4f2d","2023-05-02 00:00:00","2023-05-02 23:59:59"); //// dataFlickerService.getDataFlicker("ff2d9674c1f1ecce7f33a5bf17fc4f2d","2023-05-02 00:00:00","2023-05-02 23:59:59");
// List<DataV> ss = dataVService.getDataV("ff2d9674c1f1ecce7f33a5bf17fc4f2d", "2023-05-02 00:00:00", "2023-05-02 23:59:59"); //// List<DataV> ss = dataVService.getDataV("ff2d9674c1f1ecce7f33a5bf17fc4f2d", "2023-05-02 00:00:00", "2023-05-02 23:59:59");
// System.out.println(ss); //// System.out.println(ss);
//
StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData("4","data_harmpower_p","W","A","max"); // StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData("4","data_harmpower_p","W","A","max");
System.out.println("statisticalDataDTO==:" + statisticalDataDTO); // System.out.println("statisticalDataDTO==:" + statisticalDataDTO);
//
//
} // }
//
} //}