开发者

java.io.FileNotFoundException No such file or directory error but directory exists

开发者 https://www.devze.com 2022-12-22 07:43 出处:网络
I\'m getting the filenotfoundexception on my apps directory but my directory clearly exists.I\'m doing this on my local machine.I\'m doing a very simple post to a servlet.Does anyone knw what could be

I'm getting the filenotfoundexception on my apps directory but my directory clearly exists. I'm doing this on my local machine. I'm doing a very simple post to a servlet. Does anyone knw what could be hap开发者_C百科pening?


it turns out this was due to my firewall (firestarter) blocking my servers ip address. I allowed the exception and everything worked.


A few of thoughts (hopefully you haven't tried them :-):

Do you have read access to the directory?

Try putting in something like:

System.out.println("the directory = " + directory);

Assuming "directory" is the File variables that holds the directory.

Try putting in something like:

System.out.println("the directory exists = " + directory.exists());

and making sure it returns true.


Do you have traversal authority to all intervening path segments, and appropriate authority to the final file?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号