Skip to content

Commit 9189478

Browse files
committed
Handle spaces in installation paths in WindowsDefenderConfigurator
Fixes #1757
1 parent 5e8f083 commit 9189478

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WindowsDefenderConfigurator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import java.io.BufferedReader;
2020
import java.io.IOException;
21+
import java.net.URI;
2122
import java.net.URISyntaxException;
2223
import java.nio.charset.StandardCharsets;
2324
import java.nio.file.Path;
@@ -40,6 +41,7 @@
4041
import org.eclipse.core.runtime.Platform;
4142
import org.eclipse.core.runtime.Status;
4243
import org.eclipse.core.runtime.SubMonitor;
44+
import org.eclipse.core.runtime.URIUtil;
4345
import org.eclipse.core.runtime.jobs.Job;
4446
import org.eclipse.core.runtime.preferences.ConfigurationScope;
4547
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
@@ -269,7 +271,8 @@ private static Optional<Path> getInstallationLocation() {
269271
// https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html&anchor=locations
270272
try {
271273
Location installLocation = Platform.getConfigurationLocation();
272-
return Optional.of(Path.of(installLocation.getURL().toURI())); // assume location has a file-URL
274+
URI location = URIUtil.toURI(installLocation.getURL());
275+
return Optional.of(Path.of(location)); // assume location has a file-URL
273276
} catch (URISyntaxException e) { // ignore
274277
}
275278
return Optional.empty();

0 commit comments

Comments
 (0)