很久很久以前

            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
          主站蜘蛛池模板: 丰台区| 北宁市| 元谋县| 巴彦淖尔市| 岐山县| 浦东新区| 淮南市| 台东市| 内江市| 同仁县| 封开县| 巫山县| 望都县| 馆陶县| 井冈山市| 阳西县| 赫章县| 自贡市| 涪陵区| 道孚县| 株洲市| 无锡市| 青龙| 苗栗县| 新化县| 舞阳县| 张家川| 北碚区| 偏关县| 仲巴县| 和林格尔县| 泰州市| 镇巴县| 屏南县| 色达县| 碌曲县| 富蕴县| 鄱阳县| 巴中市| 合川市| 昌都县|