1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-14 11:23:42 +02:00
Sonarr/NzbDrone.Core/Providers/Core/ArchiveProvider.cs

25 lines
626 B
C#
Raw Normal View History

2011-11-13 07:07:06 +03:00
using System.Linq;
using Ionic.Zip;
using NLog;
2010-09-23 06:19:47 +03:00
2011-04-04 06:50:12 +03:00
namespace NzbDrone.Core.Providers.Core
2010-09-23 06:19:47 +03:00
{
2011-11-13 07:07:06 +03:00
public class ArchiveProvider
2010-09-23 06:19:47 +03:00
{
2011-11-13 07:07:06 +03:00
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
public virtual void ExtractArchive(string compressedFile, string destination)
{
2011-11-13 07:07:06 +03:00
logger.Trace("Extracting archive [{0}] to [{1}]", compressedFile, destination);
using (ZipFile zipFile = ZipFile.Read(compressedFile))
{
zipFile.ExtractAll(destination);
}
2011-11-13 07:07:06 +03:00
logger.Trace("Extraction complete.");
}
2010-09-23 06:19:47 +03:00
}
}