public static URL find(String bundleId, String path) {
return find(Platform.getBundle(bundleId), path);
}
-
+
public static File findFile(String bundleId, String path) throws IOException {
URL url = find(bundleId, path);
if (url == null)
url = FileLocator.toFileURL(url);
return new File(url.getPath());
}
-
+
+ /**
+ * @since 1.31.0
+ */
+ 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());
+ }
+ return null;
+ }
+
}