当前位置: 代码迷 >> Java Web开发 >> 系统找不到指定的路径,该如何处理
  详细解决方案

系统找不到指定的路径,该如何处理

热度:3985   发布时间:2016-04-10 22:49:31.0
系统找不到指定的路径
//获取到一个路径
String fileURL = request.getSession().getServletContext()
.getRealPath("xml/" + newTime + ".xml");
//使用File创建文件
File file = new File(fileURL);
                   file.createNewFile(); 
报了两个错
java.io.IOException: 系统找不到指定的路径。
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:947)

java.io.FileNotFoundException: F:\workplace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\chatroom\xml\20140306.xml (系统找不到指定的路径。)

求大虾指教
------解决方案--------------------
没有这个路径啊,要先创建文件夹
  相关解决方案