本帖最后由 java2000_net 于 2008-08-04 15:35:22 编辑

解决方案 »

  1.   

    没看过这种写法
    你的a.doc应该写相对路径才对吧
      

  2.   

    Creates a new File instance by converting the given file: URI into an abstract pathname. 
    The exact form of a file: URI is system-dependent, hence the transformation performed by this constructor is also system-dependent. For a given abstract pathname f it is guaranteed that new File( f.toURI()).equals( f.getAbsoluteFile()) 
    so long as the original abstract pathname, the URI, and the new abstract pathname are all created in (possibly different invocations of) the same Java virtual machine. This relationship typically does not hold, however, when a file: URI that is created in a virtual machine on one operating system is converted into an abstract pathname in a virtual machine on a different operating system. 
      

  3.   

    InputStream input = null;
    try {
    input = new URL("http://www.socs.uts.edu.au/MosaicDocs-old/url-primer.html ").openStream();
    } catch (MalformedURLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();

    BufferedReader in2 = new BufferedReader(new InputStreamReader(input)); 
    try {
    in2.readLine();
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }这个试试!网上找了找!好像你那种是不行
      

  4.   

    URI scheme is not "file" 
    按字面意识应该是uri应该以“file”开头
      

  5.   

    songshuxing :
         用你的方法抛出异常: java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
      

  6.   

    看File的构造函数中有File(URI uri),应该不会太复杂吧?
    有高手指点一下吗?
      

  7.   

    直接这样写呢File file = new File("http://127.0.0.1:8080/source/a.doc"); 
      

  8.   

    你URI的Scheme是http,你这种实现方式必须是file才行