From acf5b0b6ed173a3a9540d0585bd491a119d524cf Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Thu, 21 Feb 2013 00:00:56 -0500 Subject: isolated DotNetZip dependancy --- .../Updates/InstallationManager.cs | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'MediaBrowser.Controller/Updates') diff --git a/MediaBrowser.Controller/Updates/InstallationManager.cs b/MediaBrowser.Controller/Updates/InstallationManager.cs index 63afa2ce88..8b4a613b9c 100644 --- a/MediaBrowser.Controller/Updates/InstallationManager.cs +++ b/MediaBrowser.Controller/Updates/InstallationManager.cs @@ -1,11 +1,11 @@ using System.Security.Cryptography; -using Ionic.Zip; using MediaBrowser.Common.Events; using MediaBrowser.Common.Kernel; using MediaBrowser.Common.Net; using MediaBrowser.Common.Plugins; using MediaBrowser.Common.Progress; using MediaBrowser.Common.Serialization; +using MediaBrowser.Model.IO; using MediaBrowser.Model.Updates; using System; using System.Collections.Concurrent; @@ -91,14 +91,27 @@ namespace MediaBrowser.Controller.Updates } #endregion + /// + /// Gets or sets the zip client. + /// + /// The zip client. + private IZipClient ZipClient { get; set; } + /// /// Initializes a new instance of the class. /// /// The kernel. - public InstallationManager(Kernel kernel) + /// The zip client. + /// zipClient + public InstallationManager(Kernel kernel, IZipClient zipClient) : base(kernel) { + if (zipClient == null) + { + throw new ArgumentNullException("zipClient"); + } + ZipClient = zipClient; } /// @@ -391,11 +404,7 @@ namespace MediaBrowser.Controller.Updates { try { - // Extract to target in full - overwriting - using (var zipFile = ZipFile.Read(tempFile)) - { - zipFile.ExtractAll(target, ExtractExistingFileAction.OverwriteSilently); - } + ZipClient.ExtractAll(tempFile, target, true); } catch (IOException e) { -- cgit v1.2.3