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

This commit is contained in:
Dmitry Isaenko 2019-10-21 14:50:06 +03:00
parent 26bd85d744
commit 376b054c96

View file

@ -205,7 +205,8 @@ public class SettingsController implements Initializable {
File jarFile; File jarFile;
try{ 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){ catch (UnsupportedEncodingException uee){
uee.printStackTrace(); uee.printStackTrace();