我下面的程序是通过网络来获取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 。请个人大侠帮忙解决!!!
在线等!!!!