zoukankan      html  css  js  c++  java
  • Copy xml 文件

        public static void copyFailFile(String bugID) throws Exception {
            File file = new File(".");
            //get XML file path
            String xmlFilePath = file.getCanonicalPath() + "\Accounting Client\results\Accounting Client.xml";
            //new XML file
            String bugFilePath = file.getCanonicalPath() + "\Accounting Client\results\" + bugID + ".xml";
            //read XML file
            BufferedReader reader = new BufferedReader(new FileReader(new File(xmlFilePath)));
            //write XML file
            BufferedWriter writer = new BufferedWriter(new FileWriter(new File(bugFilePath)));
            
            String line = "";
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null) {
                if(line.contains(""")) {
                    line = line.replace(""", """);
                }else if(line.contains(">")) {
                    line = line.replace(">", ">");
                }
                sb.append(line + "
    ");
            }
            writer.append(sb.toString());
            writer.flush();
            writer.close();
            reader.close();
        }
  • 相关阅读:
    CCF 201712-4
    图论_最短路径
    图论_查并集
    let和const
    Promise
    实现表单label两端对齐
    始终让footer在底部
    react——使用this.setState({ })修改state状态值
    react——css样式
    react脚手架
  • 原文地址:https://www.cnblogs.com/xriverside/p/4269976.html
Copyright © 2011-2022 走看看