日期:2014-05-17  浏览次数:20731 次

系统找不到指定的路径
//获取到一个路径
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 (系统找不到指定的路径。)

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