1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-11 05:22:44 +01:00
Radarr/NzbDrone.Core/Providers/Core/ArchiveProvider.cs

27 lines
687 B
C#
Raw Normal View History

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