獲得插件的絕對路徑:

????/**?*//**
?????*?得到插件的絕對路徑
?????*?
?????*?@return?路徑
?????*/

????public?static?String?getPath()?
{
????????String?path;

????????try?
{
????????????path?=?FileLocator.toFileURL(
????????????????????Platform.getBundle(pluginId).getEntry("")).getPath();
????????????path?=?path.substring(path.indexOf("/")?+?1,?path.length());

????????}?catch?(IOException?e)?
{
????????????path?=?"";
????????????e.printStackTrace();
????????}
????????return?path;
????}其中FileLocator#toFileURL是在3.2中添加的,代替了原來的Platform#asLocalURL,并且對于FileLocator#toFileURL,if the plugin was a jar, it will extract the file into a temporary location























