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 閱讀(767) 評論(0)  編輯  收藏 所屬分類: 代碼碎片


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


          網站導航:
           
          主站蜘蛛池模板: 阿克| 抚顺县| 菏泽市| 江津市| 繁峙县| 微博| 南京市| 东乡县| 广丰县| 乌兰浩特市| 合山市| 岑巩县| 济阳县| 武川县| 交城县| 蓬安县| 安福县| 陈巴尔虎旗| 临夏市| 云阳县| 榆树市| 通许县| 大英县| 龙南县| 资阳市| 聂荣县| 沙湾县| 连云港市| 防城港市| 古浪县| 顺平县| 和林格尔县| 嘉义县| 乐东| 孟村| 长武县| 当阳市| 安阳县| 原阳县| 普洱| 武胜县|