java web service 写入图片到webimg

mac2022-06-30  54

获取本类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();

转载于:https://www.cnblogs.com/zhaocundang/p/10130832.html

最新回复(0)