`

FileInputStream不支持从网络路径获取数据

    博客分类:
  • java
阅读更多
FileInputStream不支持从网络路径获取数据,否则有出问题:如
FileInputStream input = new FileInputStream("http://www.test.com/upload/test.xlsx")

抛出异常http:\www.test.com\upload\test.xlsx---因为是window系统
所以可以使用
URL url = new URL("http://www.test.com/upload/test.xlsx");
FileInputStream input = new BufferedInputStream(url.openStream());
分享到:
评论
1 楼 hgg923 2019-05-23  
学习了,试试先

相关推荐

Global site tag (gtag.js) - Google Analytics