获取本类service路径,然后字符串截取和拼接
String classpath= this.getClass().getResource("/").getPath();
String path = classpath.substring(0,classpath.length() - "WEB-INF/classes/".length());
System.out.println(path);
Path file=new File(path+"assets/img/code.png").toPath();
java web service 写入图片到web/img/
猜你喜欢
转载自www.cnblogs.com/zhaocundang/p/10130832.html
今日推荐
周排行