下面的錯誤代碼如下: 我將FileInputStream構造函數中的完整添加名傳遞給文件名。 EX-: 本地主機:8080 /項目名稱/ OuterFolder/InnerFloder/example.doc帶有限定文件名的FileInputStream中的java.io.FileNotFoundException
logger.info("File Path: "+ path+"/OuterFolder/InnerFloder/"+fileName);
POIFSFileSystem fs = new POIFSFileSystem(new
FileInputStream(path+"/OuterFolder/InnerFloder/"+fileName));
http:\localhost:8080\projectName\OuterFolder\InnerFloder\Example.doc (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at com.avi.service.UserService.createPolicy(UserService.java:1339)
at com.avi.service.UserService$$FastClassByCGLIB$$de8fbe27.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:617)
at com.avi.service.UserService$$EnhancerByCGLIB$$7c22f094_2.createPolicy(<generated>)
at com.avi.controller.TestController.openPolicy(TestController.java:2733)
不應該在雙引號內(第二行)「Example.doc」? –
什麼是日誌輸出?什麼是「路徑」? –
路徑是一個字符串變量,具有如下完整路徑: - http:// localhost:8080/projectName/ – Avinash