gpt4 book ai didi

java - 文件未在 Java 中访问

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:23:02 25 4
gpt4 key购买 nike

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)

最佳答案

更改为:

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

确保\\在文件路径中。

关于java - 文件未在 Java 中访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18191492/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com