java.io.FileNotFoundException on an existing file

后端 未结 5 1567
离开以前
离开以前 2021-02-15 17:47

I am getting this error when I try to open a file:

java.io.FileNotFoundException: D:\\Portable%20Programs\\Android%20Development\\workspace3\\XXX-desktop\\bin\\W         


        
5条回答
  •  醉酒成梦
    2021-02-15 17:53

    The preferred way to convert a file: URL into an actual File is this:

    File file = new File(url.toURI());
    

    This takes care of all checks and quoting/escaping.

    Using getPath() instead will leave these odd bits up to you.

提交回复
热议问题