代码之家  ›  专栏  ›  技术社区  ›  Atma

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

  •  0
  • Atma  · 技术社区  · 16 年前

    3 回复  |  直到 16 年前
        1
  •  2
  •   Atma    16 年前

    原来这是因为我的防火墙(firestarter)阻止了我的服务器ip地址。我允许这个例外,一切正常。

        2
  •  1
  •   Josh    14 年前

    一些想法(希望您没有尝试过:-):

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

    假设“directory”是保存目录的文件变量。

    试着输入以下内容:

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

        3
  •  0
  •   L. Cornelius Dol    16 年前

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