1. 程式人生 > >java.io.FileNotFoundException: (系統找不到指定的路徑。)

java.io.FileNotFoundException: (系統找不到指定的路徑。)

ces native out eno 系統 open 報錯 ati pen

報錯 :java.io.FileNotFoundException: (系統找不到指定的路徑。)

java.io.FileNotFoundException: E:\code\operem_demo\src\main\resources\static\upload\zip\841195824A88E198C82A9ABB8023522D.zip (系統找不到指定的路徑。)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:162)

錯誤分析 路徑不存在,所以報錯

解決方法 : 檢查路徑,文件是否存在,如果不存在是否創建。

java.io.FileNotFoundException: (系統找不到指定的路徑。)