問題
文件下載時 路徑帶空格自動轉(zhuǎn)化成%20導致FileNotFoundException系統(tǒng)找不到指定的路徑莉恼。
image.png
image.png
解決方法
//防止空格路徑報錯
try {
srcPath = URLDecoder.decode(srcPath,"utf-8");
}catch (UnsupportedEncodingException e){
e.printStackTrace();
}