不要用file 要用inputStream
Resource resource = new ClassPathResource(certPath);
InputStream certStream = resource.getInputStream();
this.certData = new byte[certStream.available()];
certStream.read(this.certData);
如果使用
File sourceFile = resource.getFile();
那么 肯定就會(huì)報(bào)錯(cuò)
因?yàn)槟愦虬氖莏ar包,jar包里是沒有文件系統(tǒng)的
image.png