aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common.Implementations
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-12-28 01:21:39 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-12-28 01:21:39 -0500
commit5278959edef763bdf0b4d72ace75efd151ab5024 (patch)
treeacdcd09a21cd3f549a086589e89656181df56bf5 /MediaBrowser.Common.Implementations
parent7bce2e04b618671faafc32a39978d0d8c87cba21 (diff)
sync fixes
Diffstat (limited to 'MediaBrowser.Common.Implementations')
-rw-r--r--MediaBrowser.Common.Implementations/Archiving/ZipClient.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/MediaBrowser.Common.Implementations/Archiving/ZipClient.cs b/MediaBrowser.Common.Implementations/Archiving/ZipClient.cs
index 23d40cf67..c32134d4f 100644
--- a/MediaBrowser.Common.Implementations/Archiving/ZipClient.cs
+++ b/MediaBrowser.Common.Implementations/Archiving/ZipClient.cs
@@ -4,6 +4,7 @@ using SharpCompress.Archive.SevenZip;
using SharpCompress.Archive.Tar;
using SharpCompress.Common;
using SharpCompress.Reader;
+using SharpCompress.Reader.Zip;
using System.IO;
namespace MediaBrowser.Common.Implementations.Archiving
@@ -48,6 +49,21 @@ namespace MediaBrowser.Common.Implementations.Archiving
}
}
+ public void ExtractAllFromZip(Stream source, string targetPath, bool overwriteExistingFiles)
+ {
+ using (var reader = ZipReader.Open(source))
+ {
+ var options = ExtractOptions.ExtractFullPath;
+
+ if (overwriteExistingFiles)
+ {
+ options = options | ExtractOptions.Overwrite;
+ }
+
+ reader.WriteAllToDirectory(targetPath, options);
+ }
+ }
+
/// <summary>
/// Extracts all from7z.
/// </summary>