我在main函数中调用
public static boolean FileExist2(String path, String fname) {
File file = new File(path + "\\" + fname);
if (file.exists())
return true;
else
return false;
}
没问题,path=\\Backup01\msgstore\gbc\c12\e26\prompts fname=700.wav
但在jsp中调用这个函数就出来错误结果而且我在tomcat中引用这个目录出现如下错误
java.lang.IllegalArgumentException: Document base \\Backup01\msgstore does not exist or is not a readable directory
以前一直是好的
不知道为什么
public static boolean FileExist2(String path, String fname) {
File file = new File(path + "\\" + fname);
if (file.exists())
return true;
else
return false;
}
没问题,path=\\Backup01\msgstore\gbc\c12\e26\prompts fname=700.wav
但在jsp中调用这个函数就出来错误结果而且我在tomcat中引用这个目录出现如下错误
java.lang.IllegalArgumentException: Document base \\Backup01\msgstore does not exist or is not a readable directory
以前一直是好的
不知道为什么
就是把输入的相对路径转换为绝对路径来找。或者是转换为相对与某个固定的约定路径的位置来判断。
这样java会认为是相对路径吗?
Document base \\Backup01\msgstore does not exist or is not a readable directory已经告诉你了,不是路径的问题就是目录只读的问题.