1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-27 10:07:10 +00:00
Lidarr/NzbDrone.Common/ArchiveProvider.cs

23 lines
601 B
C#
Raw Normal View History

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