Skip to content

Commit 717ee0c

Browse files
committed
Fix Workbench.setEdgeDataDirectory(Display) in case of path with spaces
URLs returned by org.eclipse.osgi.service.datalocation.Location.getDataArea(String) are not strictly valid URIs as well, e.g. they do not properly encode space characters. Do not use #toUri() but let java.io.File(String) deal with it instead. Same approach is also used in org.eclipse.e4.ui.css.swt.internal.theme.ThemeEngine.ThemeEngine constructor. Fixes #2725.
1 parent dbf808e commit 717ee0c

File tree

1 file changed

+5
-5
lines changed
  • bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal

1 file changed

+5
-5
lines changed

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/Workbench.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import com.ibm.icu.util.ULocale;
3030
import com.ibm.icu.util.ULocale.Category;
3131
import java.io.BufferedInputStream;
32+
import java.io.File;
3233
import java.io.FileInputStream;
3334
import java.io.IOException;
3435
import java.io.InputStream;
@@ -37,7 +38,6 @@
3738
import java.net.URI;
3839
import java.net.URISyntaxException;
3940
import java.net.URL;
40-
import java.nio.file.Paths;
4141
import java.util.ArrayList;
4242
import java.util.Arrays;
4343
import java.util.Collection;
@@ -529,10 +529,10 @@ private static void setEdgeDataDirectory(Display display) {
529529
return;
530530
}
531531
try {
532-
URI swtMetadataLocationURI = workspaceLocation
533-
.getDataArea(FrameworkUtil.getBundle(Browser.class).getSymbolicName()).toURI();
534-
display.setData(EDGE_USER_DATA_FOLDER, Paths.get(swtMetadataLocationURI).toString());
535-
} catch (URISyntaxException | IOException e) {
532+
URL swtMetadataLocationURL = workspaceLocation
533+
.getDataArea(FrameworkUtil.getBundle(Browser.class).getSymbolicName());
534+
display.setData(EDGE_USER_DATA_FOLDER, new File(swtMetadataLocationURL.getFile()).toString());
535+
} catch (IOException e) {
536536
WorkbenchPlugin.log("Invalid workspace location to be set for Edge browser.", e); //$NON-NLS-1$
537537
}
538538
}

0 commit comments

Comments
 (0)