java.io.FileNotFoundException
1.引起这种错误是多方面的,我的是因为文件夹是中文。用的是org.springframework.util.ResourceUtils
获取路径
String pathstr = ResourceUtils.getURL("classpath:").getPath();
String inPath = pathstr + "templates/module.xls";
获取到的pathstr =D:\Team3\%e6%b1%9f%e8%8b%8f\%e5%8d%97%e4%ba%ac%e8%ae%a1%e9%87%8f%e9%99%a2\
,这样肯定是读取不到我的w10路径
2.修改后
String pathstr = ResourceUtils.getURL("classpath:").getPath();
//解决路径包含中文的情况
pathstr= URLDecoder.decode(pathstr,"utf-8");
String inPath = pathstr + "templates/module.xls";
3.利用java.net.URLDecoder
得到pathstr =D:\Team3\项目\,