From version 2.1
edited by Guido Kracke
on 2019/08/23 10:54
To version 3.1
edited by Guido Kracke
on 2019/08/23 10:59
Change comment: There is no comment for this version

Summary

Details

ExtensionCode.ExtensionClass[0]
Description
... ... @@ -1,4 +1,4 @@
1 -You have to adapt the variables ##exclude##, ##include## and ##backupPath## to your needs
1 +You have to adapt the variables ##exclude##, ##include##, ##backupFile## and ##backupPath## to your needs
2 2  
3 3  {{code}}
4 4  {{groovy}}
... ... @@ -21,7 +21,8 @@
21 21  
22 22  ArrayList<String> exclude = ["Help", "Menu", "XWiki", "Sandbox", "ScriptingDocumentation"]
23 23  ArrayList<String> include = ["XWiki.DefaultSkin"]
24 -String backupPath = "C:/Robo/backups/Robo"
24 +String backupFile = "Robo.${now}.xar"
25 +String backupPath = "C:/Robo/backups/${backupFile}"
25 25  
26 26  ArrayList<String> names = []
27 27  Document home = xwiki.getDocument("Main.WebHome")
... ... @@ -158,9 +158,9 @@
158 158   packageBackupPack: Boolean.TRUE
159 159   ]
160 160   if (request.target == "Server") {
161 - oProps["target"] = new File("${backupPath}.${now}.xar")
162 + oProps["target"] = new File(backupPath)
162 162   } else {
163 - String filename = Util.encodeURI("Robo.${now}.xar", xcontext.getContext())
164 + String filename = Util.encodeURI(backupFile, xcontext.getContext())
164 164   XWikiServletResponse response = xcontext.getResponse()
165 165   response.setContentType("application/zip")
166 166   response.setHeader("Content-disposition", "attachment; filename=${filename}")

Get Connected