今日份代码:
private static final String UPLOAD_TEMP_FILE_NAME = "测试商品数据.xlsx"; /** * 获取临时文件路径 * @return */ private String getFilePath(){ String path = 当前类.class.getResource("/").getPath()+UPLOAD_TEMP_FILE_NAME; return path; }
【spring】【spring boot】获取系统根路径,根目录,用于存储临时生成的文件在服务器上
原文:https://www.cnblogs.com/sxdcgaq8080/p/11660950.html