From 376b054c966eb2f43af720d4b2fa658a67368faa Mon Sep 17 00:00:00 2001 From: Dmitry Isaenko Date: Mon, 21 Oct 2019 14:50:06 +0300 Subject: [PATCH] Fix application failure on start when JAR file saved into the folders that has '+' in name. --- src/main/java/nsusbloader/Controllers/SettingsController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/nsusbloader/Controllers/SettingsController.java b/src/main/java/nsusbloader/Controllers/SettingsController.java index c8950e9..820456a 100644 --- a/src/main/java/nsusbloader/Controllers/SettingsController.java +++ b/src/main/java/nsusbloader/Controllers/SettingsController.java @@ -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();