Copy xml 文件
2024-08-31 03:49:41
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 + "\n");
}
writer.append(sb.toString());
writer.flush();
writer.close();
reader.close();
}
最新文章
- RobotFramework自动化测试之脚本编写(一)
- DDD 领域驱动设计-看我如何应对业务需求变化?
- E2 2014.5.8 更新日志
- associated 2 maps
- Winedt10 添加自定义宏
- Eclipse中文乱码解决汇总(应该比较全):
- ENode框架初始化
- django进阶-3
- Redis——windows环境安装redis和redis sentinel部署
- python——Pycharm的简单介绍
- 如何利用GitHub搜索敏感信息
- idea取消vim模式
- VIM -小技巧汇总
- SQL Server 操作XML数据
- C# 反编译项目修复
- [转]学习C#:Attribute与Property
- PAT 甲级 1021 Deepest Root
- Bootstrap学习--基本格式
- Daily Scrum6 11.10
- CCLayer设置anchorPoint无效的问题