获取webapp下的img路径

使用ApplicationHome 获取当前文件的路径 ,ApplicationHome只能在springboot工程中使用
// 上传地址
ApplicationHome applicationHome = new ApplicationHome(ImageUtils.class);
String path = applicationHome.getSource().getParentFile().getParentFile().getParentFile().getPath()
+ "\\SuperMarket-web\\src\\main\\webapp\\img";