Fix application failure on start when JAR file saved into the folders that has '+' in name.

master
Dmitry Isaenko 2019-10-21 14:50:06 +03:00
parent 26bd85d744
commit 376b054c96
1 changed files with 2 additions and 1 deletions

View File

@ -205,7 +205,8 @@ public class SettingsController implements Initializable {
File jarFile;
try{
jarFile = new File(URLDecoder.decode(getClass().getProtectionDomain().getCodeSource().getLocation().getPath(), "UTF-8"));
String encodedJarLocation = getClass().getProtectionDomain().getCodeSource().getLocation().getPath().replace("+", "%2B");
jarFile = new File(URLDecoder.decode(encodedJarLocation, "UTF-8"));
}
catch (UnsupportedEncodingException uee){
uee.printStackTrace();