惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 老猫

34t 我依然沉默 莫须有的不担心 为明天的测试做准备 i think wfasd f fdsaf 郁闷郁闷 Blog Jet first blog 路在何方! 今年我27岁! 忙而无效的一天 要学的东西很多很多 什么样的一天 心事的一天 成功经理人34个好习惯 关于新年 from now on
垃圾代码
老猫 · 2005-12-24 · via 博客园 - 老猫

 private int  setTxtToXml(ProcessExDTO proExDTO)
    {   File file=null;
        proExDTO.logger(">>>>>>>>>>>:"+"setTxtToXml");
        ESoFlowDocument eSoFlowDocument=null;
        int i=0;
        try{
            String path="/orderXMLFile/"+ proExDTO.getXmlPath()+"/"+ proExDTO.getSo_nbr()+".xml";
           // String s2 = new String(myMSG.getText().getBytes("ISO-8859-1"),"GBK");      
            file=new File(System.getProperty("user.dir")+path );
            String serv=proExDTO.getServPara();
            HashMap servMap= new HashMap();
            if("eaiAppServer11".equals(serv)||"eaiAppServer12".equals(serv)||"eaiAppServer13".equals(serv)){
                serv="133.224.203.5";
            }else{
                serv="133.224.203.6";
            }
            System.out.println("serv:"+serv);
            while((i<5)&&(!file.exists())){
               // Process ps = Runtime.getRuntime().exec("ftp -inv ");
              //  Runtime.getRuntime().exec("open "+serv+" ");
              //  Runtime.getRuntime().exec("user weblogic weblogic123 ");
              //  Runtime.getRuntime().exec("bin \n");
              //  Runtime.getRuntime().exec("get /apps/NodeManager"+path +" /Bea/apps/NodeManager/errorXMLFile/"+proExDTO.getSo_nbr()+".xml ");
              //  Runtime.getRuntime().exec("bye ");
              //  file=new File(System.getProperty("user.dir")+ "/errorXMLFile/" + proExDTO.getSo_nbr()+".xml");
                StringBuffer myBuffer = new StringBuffer();
                myBuffer.append("open "+serv+" \n");
                myBuffer.append("user weblogic weblogic123 \n");
                //myBuffer.append("cd /Bea/apps/NodeManager/orderXMLFile/"+proExDTO.getXmlPath()+" \n");
                myBuffer.append("bin \n");
                myBuffer.append("get /apps/NodeManager/orderXMLFile/"+proExDTO.getXmlPath()+"/"+ proExDTO.getSo_nbr() +".xml /Bea/apps/NodeManager/errorXMLFile/"+proExDTO.getSo_nbr()+".xml \n");
                myBuffer.append("bye");
                File myFile = new File("/Bea/apps/NodeManager/errorXMLFile/"+proExDTO.getSo_nbr()+".txt");
                FileOutputStream out = new FileOutputStream(myFile);
                OutputStreamWriter osw = new OutputStreamWriter(out);
                osw.write(myBuffer.toString());
                osw.flush();

                                File myFile1 = new File("/Bea/apps/NodeManager/errorXMLFile/"+proExDTO.getSo_nbr()+"B.txt");
                FileOutputStream out1 = new FileOutputStream(myFile1);
                OutputStreamWriter osw1 = new OutputStreamWriter(out1);
                osw1.write("ftp -inv < "+myFile);
                osw1.flush();

                                proExDTO.logger("myFile:"+myFile);
               // Process ps = Runtime.getRuntime().exec("ftp -inv < "+myFile);
                 Process ps = Runtime.getRuntime().exec("sh "+myFile1);
                proExDTO.logger("process error:"+ps.getErrorStream());
                proExDTO.logger("process input:"+ps.getInputStream());
                proExDTO.logger("process output:"+ps.getOutputStream());

                                //String cmd = "sh getXML.bat";
                //Process ps = Runtime.getRuntime().exec(cmd);           
                file=new File(System.getProperty("user.dir")+ "/errorXMLFile/" + proExDTO.getSo_nbr()+".xml");
                i++;
            }
            System.out.println("EXIST:"+file.exists());
            if(file.exists()) {
                eSoFlowDocument = ESoFlowDocument.Factory.parse(file);
                proExDTO.setYyXml(eSoFlowDocument); 
            }
            else{
                proExDTO.setRtnNum(-1003);
                return -1;
            }
            return 0;
        }catch(Exception ex){
            //return this.doError(proExDTO,ex,"setTxtToXml");
           // this.getRemotFile(proExDTO);//本地取文本失败,读取
           proExDTO.setRtnNum(-1003);
           return this.doError(proExDTO,ex,"setTxtToXml");
        }
        /*
        finally{
           if(proExDTO.getYyXml()!=null) {
            return 0;
           }
           else {
            proExDTO.setRtnNum(-1003);
            return -1;
           }
        }
        */
    }

posted on 2005-12-24 23:03  老猫  阅读(275)  评论()    收藏  举报