想用网络资源写服务器
[list]
[*][code="java"]URI ui = new URI("http://xxx.xxxxxxx.com/xxxxxxxx/文件名.xml");
[*] File f = new File(ui);
[*]
[*] FileInputStream is = new FileInputStream(f) ;
[*] BufferedReader reader = new BufferedReader(new java.io.InputStreamReader(is,"utf-8"));
[*]
[*] String inputLine = null;
[*] while ((inputLine = reader.readLine()) != null) {
[*] System.out.println(inputLine);
[*] }[/code]
[/list]
报错如下
[code="java"]Exception in thread "main" java.lang.IllegalArgumentException: URI scheme is not "file"
at java.io.File.(Unknown Source)
at something.Test1.main(Test1.java:19)[/code]
这是和解?我直接在网页输入该URI可以访问到