-
- private Path getPath() throws IOException {
- try {
- return Paths.get(FileLocator.toFileURL(url).toURI());
- } catch (URISyntaxException e) {
- throw new IOException(e);
+
+ /*
+ * This code is a copy from org.simantics.utils.ui.BundleUtils
+ */
+ public static File resolveWritableBundleFile(URL url) throws IOException {
+ // This returns file, jar, http etc. - essentially resolves the bundle protocol
+ URL resolved = FileLocator.resolve(url);
+ if (resolved.getProtocol().equals("file")) {
+ return new File(resolved.getPath());