我已經這樣做了:文件未發現異常
File inputPropertiesFile = new File("/Users/adrian/Documents/workspace/Ronan/src/watermarker/test");
InputStream propertiesStream = new FileInputStream(inputPropertiesFile);
,但我得到這個異常:
java.io.FileNotFoundException: /Users/adrian/Documents/workspace/Ronan/src/watermarker/test (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:120)
但該文件是在該位置fooor suure.And不empty.What那裏錯了嗎?
謝謝
嘗試絕對路徑。或者確保你在一個可以找到給定相對路徑的文件的位置啓動程序。 – AHungerArtist 2012-01-12 14:02:10
你真的可以訪問該文件嗎?你能說,從命令行「貓」嗎? 'FileNotFoundException'實際上是沒用的例外:/ – fge 2012-01-12 14:03:10
可以粘貼'ls -l「/ Users/adrian/Documents/workspace/Ronan/src/watermarker/test」'命令的輸出嗎? – 2012-01-12 14:03:22