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

推荐订阅源

量子位
Recorded Future
Recorded Future
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
宝玉的分享
宝玉的分享
P
Proofpoint News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Scott Helme
Scott Helme
酷 壳 – CoolShell
酷 壳 – CoolShell
大猫的无限游戏
大猫的无限游戏
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
Lohrmann on Cybersecurity
Project Zero
Project Zero
Spread Privacy
Spread Privacy
T
Threat Research - Cisco Blogs
S
Schneier on Security
S
SegmentFault 最新的问题
G
GRAHAM CLULEY
J
Java Code Geeks
IT之家
IT之家
爱范儿
爱范儿
Latest news
Latest news
阮一峰的网络日志
阮一峰的网络日志
P
Palo Alto Networks Blog
Jina AI
Jina AI
腾讯CDC
V
Visual Studio Blog
Apple Machine Learning Research
Apple Machine Learning Research
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tor Project blog
T
Threatpost
V
V2EX
D
Darknet – Hacking Tools, Hacker News & Cyber Security
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - Franky
美团技术团队
小众软件
小众软件
NISL@THU
NISL@THU
Simon Willison's Weblog
Simon Willison's Weblog
T
The Exploit Database - CXSecurity.com
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Securelist
V
Vulnerabilities – Threatpost
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
A
Arctic Wolf
U
Unit 42
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org

博客园 - 老猫

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  老猫  阅读(276)  评论()    收藏  举报