现在想获取invoice.pdf文件的路径
获取方法:
import .springframework.util.ClassUtils;
public class PrintController {public void monitoringPrint() {//获取项目classes/static的地址String staticPath = ClassUtils.getDefaultClassLoader().getResource("static").getPath();File file=new File(staticPath+"/invoice.pdf");}
}
更多推荐
路径,文件,项目,springboot
发布评论