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

推荐订阅源

V
Visual Studio Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
Netflix TechBlog - Medium
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
V
V2EX
IT之家
IT之家
J
Java Code Geeks
Hacker News - Newest:
Hacker News - Newest: "LLM"
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
GbyAI
GbyAI
D
Docker
S
Secure Thoughts
Recent Announcements
Recent Announcements
Webroot Blog
Webroot Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
云风的 BLOG
云风的 BLOG
博客园_首页
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Security Archives - TechRepublic
Security Archives - TechRepublic
酷 壳 – CoolShell
酷 壳 – CoolShell
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
News | PayPal Newsroom
S
Security @ Cisco Blogs
I
InfoQ
Last Week in AI
Last Week in AI
SecWiki News
SecWiki News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
W
WeLiveSecurity
T
Troy Hunt's Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Attack and Defense Labs
Attack and Defense Labs
美团技术团队
T
The Blog of Author Tim Ferriss
Google DeepMind News
Google DeepMind News
Martin Fowler
Martin Fowler
B
Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Scott Helme
Scott Helme
T
Tor Project blog
Know Your Adversary
Know Your Adversary
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
Recorded Future
Recorded Future
C
Cyber Attacks, Cyber Crime and Cyber Security
AI
AI
G
Google Developers Blog

博客园 - 老猫

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)  评论()    收藏  举报