From 51b01d0f6d21bf31a093cf7d8f88e31aba884288 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 23 Sep 2013 14:53:06 -0400 Subject: updated nuget --- .../Implementations/DotNetZipClient.cs | 48 ---------------------- .../Implementations/ZipClient.cs | 48 ++++++++++++++++++++++ 2 files changed, 48 insertions(+), 48 deletions(-) delete mode 100644 MediaBrowser.ServerApplication/Implementations/DotNetZipClient.cs create mode 100644 MediaBrowser.ServerApplication/Implementations/ZipClient.cs (limited to 'MediaBrowser.ServerApplication/Implementations') diff --git a/MediaBrowser.ServerApplication/Implementations/DotNetZipClient.cs b/MediaBrowser.ServerApplication/Implementations/DotNetZipClient.cs deleted file mode 100644 index 4a9afac3f1..0000000000 --- a/MediaBrowser.ServerApplication/Implementations/DotNetZipClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -using MediaBrowser.Model.IO; -using SharpCompress.Common; -using SharpCompress.Reader; -using System.IO; - -namespace MediaBrowser.ServerApplication.Implementations -{ - /// - /// Class DotNetZipClient - /// - public class DotNetZipClient : IZipClient - { - /// - /// Extracts all. - /// - /// The source file. - /// The target path. - /// if set to true [overwrite existing files]. - public void ExtractAll(string sourceFile, string targetPath, bool overwriteExistingFiles) - { - using (var fileStream = File.OpenRead(sourceFile)) - { - ExtractAll(fileStream, targetPath, overwriteExistingFiles); - } - } - - /// - /// Extracts all. - /// - /// The source. - /// The target path. - /// if set to true [overwrite existing files]. - public void ExtractAll(Stream source, string targetPath, bool overwriteExistingFiles) - { - using (var reader = ReaderFactory.Open(source)) - { - var options = ExtractOptions.ExtractFullPath; - - if (overwriteExistingFiles) - { - options = options | ExtractOptions.Overwrite; - } - - reader.WriteAllToDirectory(targetPath, options); - } - } - } -} diff --git a/MediaBrowser.ServerApplication/Implementations/ZipClient.cs b/MediaBrowser.ServerApplication/Implementations/ZipClient.cs new file mode 100644 index 0000000000..e9e8645e9f --- /dev/null +++ b/MediaBrowser.ServerApplication/Implementations/ZipClient.cs @@ -0,0 +1,48 @@ +using MediaBrowser.Model.IO; +using SharpCompress.Common; +using SharpCompress.Reader; +using System.IO; + +namespace MediaBrowser.ServerApplication.Implementations +{ + /// + /// Class DotNetZipClient + /// + public class ZipClient : IZipClient + { + /// + /// Extracts all. + /// + /// The source file. + /// The target path. + /// if set to true [overwrite existing files]. + public void ExtractAll(string sourceFile, string targetPath, bool overwriteExistingFiles) + { + using (var fileStream = File.OpenRead(sourceFile)) + { + ExtractAll(fileStream, targetPath, overwriteExistingFiles); + } + } + + /// + /// Extracts all. + /// + /// The source. + /// The target path. + /// if set to true [overwrite existing files]. + public void ExtractAll(Stream source, string targetPath, bool overwriteExistingFiles) + { + using (var reader = ReaderFactory.Open(source)) + { + var options = ExtractOptions.ExtractFullPath; + + if (overwriteExistingFiles) + { + options = options | ExtractOptions.Overwrite; + } + + reader.WriteAllToDirectory(targetPath, options); + } + } + } +} -- cgit v1.2.3