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


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


          網站導航:
           
          主站蜘蛛池模板: 沙湾县| 阆中市| 西青区| 西和县| 聊城市| 武隆县| 辰溪县| 岑巩县| 武冈市| 镇原县| 兰州市| 合川市| 耒阳市| 商河县| 密山市| 故城县| 揭西县| 怀远县| 湾仔区| 富宁县| 通化市| 谢通门县| 唐河县| 新河县| 兖州市| 盐池县| 高邮市| 阿瓦提县| 上虞市| 鱼台县| 光山县| 炉霍县| 错那县| 昂仁县| 嘉义县| 和田县| 久治县| 达孜县| 吴川市| 灵宝市| 乌兰浩特市|