- URL serverURL = getContext().getBundle().getEntry("/server");
- URL serverFileURL = FileLocator.toFileURL(serverURL);
- return Paths.get(serverFileURL.toURI());
+ return resolvePath("/server");
+ }
+
+ private static Path resolvePath(String entry) throws IOException, URISyntaxException {
+ URL entryURL = getContext().getBundle().getEntry(entry);
+ URL entryFileURL = FileLocator.toFileURL(entryURL);
+ URI encodedUri = new URI(entryFileURL.getProtocol(), entryFileURL.getPath(), null).normalize();
+ return Paths.get(encodedUri);