java.net.URISyntaxException

后端 未结 6 506
孤城傲影
孤城傲影 2021-01-01 11:08

I have get this exception. but this exception is not reproduced again. I want to get the cause of this

Exception Caught while Checking tag in XMLjava.net.UR         


        
6条回答
  •  遥遥无期
    2021-01-01 11:37

    You must have the string like so:

    String windowsPath = file:/C:/Users/sizu/myFile.txt;
    URI uri = new URI(windowsPath);
    File file = new File(uri);
    

    Usually, people do something like this:

    String windowsPath = file:C:/Users/sizu/myFile.txt;
    URI uri = new URI(windowsPath);
    File file = new File(uri);
    

    or something like this:

    String windowsPath = file:C:\Users\sizu\myFile.txt;
    URI uri = new URI(windowsPath);
    File file = new File(uri);
    

提交回复
热议问题