开发者

How to copy the contents of one xml file to another file in Grails?

I have created one XML f开发者_JAVA技巧ile using Grails, now I want to copy the contents of this file to a datacenter. How to do it?


It depends on how you need to make the copy of the file, if it is inside your code, i.e. programmatically, you can use AntBuilder groovy library but if it is something that you can do inside the Grails scripts you can use Ant.copy to copy the file, something like this:

Ant.copy(toFile: "${newPathForFile}/newFileName.xml", filtering: true, overwrite: true) {
  fileset(file: "${pathWhereFileIs}/fileName.xml")
}


You can use the antbuilder from groovy. Maybe you have to add some libs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜