文件无法在java中访问

时间:2013-08-12 15:58:42

标签: java linux file file-io java-io

File file = new File("\\10.200.64.8\\home\\rbts\\IBST000826");
FileInputStream fin = new FileInputStream(file);

给出错误,我也尝试过

File file = new File("file:\\10.200.64.8\\home\\rbts\\IBST000826"); 

File file = new File(new URI("file:////10.200.64.8/home/rbts/IBST000826"));

该文件在linux机器上,我在Windows机器上访问它。任何机构都可以给出建议或解决方案。

java.io.FileNotFoundException: \10.200.64.8\home\rbts\IBST000826 (The system cannot find the path specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at com.sapphire.oracle.osb.hbl.isohandler.utils.ISO_MessageUtils.getFileContent(ISO_MessageUtils.java:350)
    at com.sapphire.oracle.osb.hbl.isohandler.utils.ISO_MessageUtils.main(ISO_MessageUtils.java:366)

1 个答案:

答案 0 :(得分:2)

更改为:

File file = new File("\\\\10.200.64.8\\home\\rbts\\IBST000826");
                    //^^^^

确保文件路径中的\\