获得OSGi Bundle相关的路径信息

来源:互联网 发布:域名在哪里备案 编辑:程序博客网 时间:2024/05/29 14:21
(1)  获得OSGi Bundle安装的根路径:
FileLocator.getBundleFile(Platform.getBundle(“bundle_id”)).getAbsolutePath();
Platform.getBundle方法调用并不会Activate当前Bundle, 其只是获得当前系统内相应的被解析(Resolved)的Bundle
(2) 获得OSGi Bundle的 State Location.
Activator.getDefault().getStateLocation()
需要注意的是,该方法调用要求当前的Bundle必须是Active状态。
原创粉丝点击