GHawk

          加載Classpath中的文件(轉)

             URL url = this.getClass().getResource("EJBConfig.xml");
                  
          try {
                      File xmlFile 
          = new File(URLDecoder.decode(url.getFile(),"UTF-8"));
                      
          if(xmlFile.exists())
                          System.out.println(
          "OK");
                  } 
          catch (UnsupportedEncodingException e) {
                      e.printStackTrace();  
          //To change body of catch statement use File | Settings | File Templates.
                  }

          posted on 2006-01-19 22:07 GHawk 閱讀(775) 評論(0)  編輯  收藏 所屬分類: 代碼碎片


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 关岭| 灵武市| 吉水县| 思茅市| 麻城市| 乌兰县| 榆中县| 玉屏| 丹阳市| 柳河县| 缙云县| 深泽县| 周至县| 贵州省| 博爱县| 文安县| 黄龙县| 临朐县| 宕昌县| 隆回县| 曲周县| 台山市| 辉南县| 平南县| 金平| 兴宁市| 高陵县| 昌江| 开封县| 洪江市| 马尔康县| 城步| 衢州市| 通许县| 万年县| 龙岩市| 余江县| 肥东县| 佳木斯市| 凌海市| 德化县|