关于http读取html文件的错误

 我下面的程序是通过网络来获取html文件的

 

File file=new File(filename);

  HttpURLConnection httpConn=null;
  try {
   URL url = new URL(sourcePicturePath);
   httpConn = (HttpURLConnection)url.openConnection();
   InputStream is=httpConn.getInputStream();
   BufferedInputStream bis=new BufferedInputStream(is);
   
   OutputStream os=new FileOutputStream(file);
   BufferedOutputStream bos=new BufferedOutputStream(os);
   byte buf[] = new byte[1024 * 4];
   int count=0;
         while((count=bis.read(buf))>0){
            bos.write(buf,0,count);
         }        
         bis.close();
         is.close();
         bos.close();
         os.close();       
        
  }catch (Exception e) {
   e.printStackTrace();

}

 

我在本机测试是没有问题的,但在aix上运行就会报以下错误:

java.io.FileNotFoundException: http:/ip:port/project/mng_market/ManageEmail/TaskManage/EmailReadXml.jsp?contentId=13910386967.
html (A file or directory in the path name does not exist.)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:205)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:157)
        at email.application.xml.ReadXml.getHtmlFile(ReadXml.java:326)
        at email.application.xml.ReadXml.setHtmlFile(ReadXml.java:268)
        at email.application.xml.ResourceThreadPool.addXml(ResourceThreadPool.java:102)
        at email.application.xml.ResourceThreadPool.getXml(ResourceThreadPool.java:32)
        at email.application.xml.GetXmlObject.getXml(GetXmlObject.java:9)
        at cmod.proxy.message.control.MessageSend.sendMessageNew(MessageSend.java:73)
        at cmod.proxy.message.thread.MessageTask.perform(MessageTask.java:47)
        at cmod.proxy.message.thread.TaskThread.run(TaskThread.java:59)
操作时间2009-07-24 13:16:07 http:/ip:port/project/mng_market/ManageEmail/TaskManage/EmailReadXml.jsp?contentId=13910386967.htm
l (A file or directory in the path name does not exist.)

 

 

 

不知道为什么http后边少了一个/这个符号?

 

 

 

 

希望高人解决一下错误的原因,aix上部署的是WebSphere 。请个人大侠帮忙解决!!!

 

 

在线等!!!!

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值