【发布时间】:2012-05-16 14:06:08
【问题描述】:
我对输入和输出流有这个奇怪的东西,我就是无法理解。 我使用 inputstream 从这样的资源中读取属性文件:
Properties prop = new Properties();
InputStream in = getClass().getResourceAsStream( "/resources/SQL.properties" );
rop.load(in);
return prop;
它找到了我的文件并成功地将其变红。我尝试编写这样的修改设置:
prop.store(new FileOutputStream( "/resources/SQL.properties" ), null);
我从存储中收到奇怪的错误:
java.io.FileNotFoundException: \resources\SQL.properties (The system cannot find the path specified)
那么为什么要更改属性的路径?如何解决这个问题? 我在 Windows 上使用 Netbeans
【问题讨论】:
-
欢迎来到 SO。 +1 用于包含所有适当信息的措辞恰当的问题。
标签: java fileinputstream fileoutputstream