private static String getPath() {
String classPath = null;
try {
classPath = ResourceUtils.getURL("classpath:").getPath();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
File newFile = new File(classPath, "static/aaaaaa/");
if (!newFile.exists()) {
newFile.mkdirs();
}
return newFile.getAbsolutePath();
}
获取项目静态资源路径,在里面保存文件
最新推荐文章于 2021-08-09 19:26:07 发布