import org.apache.commons.vfs2.FileSystemManager;
import org.apache.commons.vfs2.FileSystemOptions;
import org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder;
-import org.argeo.ArgeoException;
+import org.argeo.cms.CmsException;
/**
* Simplify atomic backups implementation, especially by managing VFS.
public void init() {
if (name == null)
- throw new ArgeoException("Atomic backup name must be set");
+ throw new CmsException("Atomic backup name must be set");
}
public void destroy() {
String backupsBase, BackupContext backupContext,
FileSystemOptions opts) {
if (name == null)
- throw new ArgeoException("Atomic backup name must be set");
+ throw new CmsException("Atomic backup name must be set");
FileObject targetFo = null;
try {
+ '/' + backupContext.getRelativeFolder() + '/' + name
+ ".gz" + "!" + name, opts);
else
- throw new ArgeoException("Unsupported compression "
+ throw new CmsException("Unsupported compression "
+ compression);
writeBackup(targetFo);
return targetFo.toString();
} catch (Exception e) {
- throw new ArgeoException("Cannot backup " + name + " to "
+ throw new CmsException("Cannot backup " + name + " to "
+ targetFo, e);
} finally {
BackupUtils.closeFOQuietly(targetFo);