java.io.FileNotFoundException on an existing file

后端 未结 5 1570
离开以前
离开以前 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:58

    You need to unescape the %20 to spaces. e.g.:

    fileLocation = new String(
        Main.class.getProtectionDomain().getCodeSource().getLocation().getPath())
        .replaceAll("%20", " ");
    

提交回复
热议问题