code
String pluginId = "com.example.plugin";
String pluginRelativePath = "demo/test.txt";
Bundle bundle = Platform.getBundle(pluginId);
URL url = bundle.getEntry(pluginRelativePath);
URL resolvedUrl = null;
try {
resolvedUrl = FileLocator.resolve(url);
} catch (IOException e) {
// TODO: handle exception
}
1 comment:
Only on Windows this creates a path beginning with / (e.g. "/C:/Program Files").
Post a Comment