mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-14 11:23:42 +02:00
27 lines
687 B
C#
27 lines
687 B
C#
using System;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using Ionic.Zip;
|
|
using NLog;
|
|
using Ninject;
|
|
using NzbDrone.Common;
|
|
|
|
namespace NzbDrone.Core.Providers.Core
|
|
{
|
|
public class ArchiveProvider
|
|
{
|
|
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
|
|
|
|
public virtual void ExtractArchive(string compressedFile, string destination)
|
|
{
|
|
logger.Trace("Extracting archive [{0}] to [{1}]", compressedFile, destination);
|
|
|
|
using (ZipFile zipFile = ZipFile.Read(compressedFile))
|
|
{
|
|
zipFile.ExtractAll(destination);
|
|
}
|
|
|
|
logger.Trace("Extraction complete.");
|
|
}
|
|
}
|
|
} |