日期:2014-05-20  浏览次数:20738 次

使用URLConnection获取InputStream失败
服务器是Linux,使用SecureCRT是可以连接通的。
代码如下:
URL url = null;
URLConnection connection = null;
filePath = "/export/home/sysm/ftproot/ebc/exportCounter/counter_20111103072421663145.xml";
url = new URL("http://10.147.212.70/" + filePath);
connection = url.openConnection();
input = connection.getInputStream();

得到connection过后,通过它获取inputStream是失败的。

请问是什么原因。谢谢


------解决方案--------------------
http://wdwheyr.iteye.com/blog/1055509
LZ你参考下呢
------解决方案--------------------
debug看看connection是不是null,

如果不为空,,又读不到数据,,那看看是不是权限问题。。。
------解决方案--------------------
探讨

http://wdwheyr.iteye.com/blog/1055509
LZ你参考下呢