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 阅读(289) 评论(0)  编辑  收藏 所属分类: 代码碎片


标题  
姓名  
主页
验证码 *  
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
 
成果网帮您增加网站收入
 
相关链接:
网站导航: