简体   繁体   English

java.io.FileNotFoundException没有此类文件或目录错误,但目录存在

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

I'm getting the filenotfoundexception on my apps directory but my directory clearly exists. 我在我的apps目录上得到了filenotfoundexception,但是我的目录显然存在。 I'm doing this on my local machine. 我正在本地计算机上执行此操作。 I'm doing a very simple post to a servlet. 我正在做一个非常简单的帖子到servlet。 Does anyone knw what could be happening? 有人知道会发生什么吗?

it turns out this was due to my firewall (firestarter) blocking my servers ip address. 原来这是由于我的防火墙(firestarter)阻止了我的服务器的IP地址。 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. 假设“目录”是保存目录的File变量。

Try putting in something like: 尝试输入以下内容:

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

and making sure it returns true. 并确保它返回true。

您是否对所有中间路径段具有遍历权限,并且对最终文件具有适当的权限?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.io.FileNotFoundException:没有这样的文件或目录错误 - java.io.FileNotFoundException: No such file or directory Error java.io.FileNotFoundException:..(无此类文件或目录) - java.io.FileNotFoundException: .. (No such file or directory) java.io.FileNotFoundException:[文件路径](没有这样的文件或目录) - java.io.FileNotFoundException: [filepath] (No such file or directory) java.io.FileNotFoundException(是一个目录) - java.io.FileNotFoundException (Is a directory) java.io.IOException:java.io.FileNotFoundException :(无此类文件或目录) - java.io.IOException: java.io.FileNotFoundException:(No such file or directory) Linux java没有此类文件或目录,java.io.FileNotFoundException: - Linux java No such file or directory, java.io.FileNotFoundException: Java FileWriter 类 - java.io.FileNotFoundException: * 没有这样的文件或目录 -Ubuntu - Java FileWriter class - java.io.FileNotFoundException: * no such file or directory -Ubuntu java.io.FileNotFoundException(没有这样的文件或目录) - 下载文件 - java.io.FileNotFoundException (No such file or directory) - Download File java.io.FileNotFoundException:(无此类文件或目录)-使用servlet - java.io.FileNotFoundException: (No such file or directory) - Working with servlets 尝试访问.wav文件时java.io.FileNotFoundException(不是目录) - java.io.FileNotFoundException (Not a directory) when attempting to access a .wav file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM