]>
git.argeo.org Git - gpl/argeo-slc.git/blob - cms/org.argeo.slc.cms/src/org/argeo/slc/backup/vfs/SvnBackup.java
1 package org
.argeo
.slc
.backup
.vfs
;
5 import org
.apache
.commons
.vfs2
.FileObject
;
7 /** Backups a Subversion repository using svnadmin. */
8 public class SvnBackup
extends OsCallBackup
{
9 private String svnadminLocation
= "/usr/bin/svnadmin";
11 private String repoLocation
;
12 private String repoName
;
17 public SvnBackup(String repoLocation
) {
18 this.repoLocation
= repoLocation
;
24 // use directory as repo name
26 repoName
= new File(repoLocation
).getName();
28 if (getName() == null)
29 setName(repoName
+ ".svndump");
34 public void writeBackup(FileObject targetFo
) {
35 if (getCommand() == null) {
36 setCommand(svnadminLocation
+ " dump " + " ${repoLocation}");
38 getVariables().put("repoLocation", repoLocation
);
40 super.writeBackup(targetFo
);
43 public void setRepoLocation(String repoLocation
) {
44 this.repoLocation
= repoLocation
;
47 public void setRepoName(String repoName
) {
48 this.repoName
= repoName
;
51 public void setSvnadminLocation(String mysqldumpLocation
) {
52 this.svnadminLocation
= mysqldumpLocation
;