FileNotFoundException" /"从URL中删除

时间:2017-04-18 13:44:53

标签: java filenotfoundexception

我得到以下异常。

Failed to GET File Details from http://192.168.2.111/storage java.io.FileNotFoundException: http:/192.168.2.111/storage/data/18-Apr-2017-ops (No such file or directory)

junit.framework.AssertionFailedError: Failed to GET File Details from http://192.168.2.111/storage java.io.FileNotFoundException: http:/192.168.2.111/storage/data/18-Apr-2017-ops (No such file or directory)
at com.billing.getlogs.GetLogsTest.countLinesOperationsUpload(GetLogsTest.java:222)
at com.billing.getlogs.GetLogsTest.GetLogsLineCountTest(GetLogsTest.java:264)

如果你看,java.io.FileNotFoundException之后的URL:在http:之后只有一个/。从属性文件中读取URL。是否有任何理由为什么这会被删除,因为/字符正确地出现在网址的其他部分。

1 个答案:

答案 0 :(得分:0)

知道了。

我改变了

InputStream is = new BufferedInputStream(new FileInputStream(text)); 

InputStream is = new BufferedInputStream(new URL(text).openStream());

我一直在尝试阅读网址的内容,但我的原始代码是用于阅读文件的内容。