1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-26 01:37:07 +00:00
Sonarr/NzbDrone.Core/Providers/BackupProvider.cs
kay.one d60b863e14 moved data from Roaming to ProgramData.
Cleaned up DiskProvider
2013-07-04 21:43:28 -07:00

36 lines
818 B
C#

using System;
using System.Linq;
using Ionic.Zip;
using NzbDrone.Common;
using NzbDrone.Common.EnvironmentInfo;
namespace NzbDrone.Core.Providers
{
public class BackupProvider
{
private readonly IAppFolderInfo _appFolderInfo;
public BackupProvider(IAppFolderInfo appFolderInfo)
{
_appFolderInfo = appFolderInfo;
}
public BackupProvider()
{
}
public virtual string CreateBackupZip()
{
var configFile = _appFolderInfo.GetConfigPath();
var zipFile = _appFolderInfo.GetConfigBackupFile();
using (var zip = new ZipFile())
{
zip.AddFile(configFile, String.Empty);
zip.Save(zipFile);
}
return zipFile;
}
}
}