很久很久以前

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            34 隨筆 :: 4 文章 :: 17 評論 :: 0 Trackbacks
          獲得插件的絕對路徑:
          ????/**
          ?????*?得到插件的絕對路徑
          ?????*?
          ?????*?
          @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
          posted on 2006-05-01 22:45 Long Long Ago 閱讀(780) 評論(0)  編輯  收藏 所屬分類: Eclipse
          主站蜘蛛池模板: 平陆县| 桃园市| 五河县| 平原县| 喀喇| 峡江县| 仲巴县| 佳木斯市| 宣汉县| 黄大仙区| 彰化县| 阿荣旗| 金华市| 鄂托克前旗| 临潭县| 共和县| 丹寨县| 罗山县| 济源市| 温州市| 巴林左旗| 额敏县| 勐海县| 齐河县| 晋州市| 宜州市| 平谷区| 获嘉县| 阿勒泰市| 长泰县| 昭通市| 门头沟区| 孟津县| 陇南市| 玉龙| 徐水县| 通化县| 阳谷县| 县级市| 昭平县| 云龙县|