diff options
Diffstat (limited to 'Emby.Server.Implementations/Archiving/ZipClient.cs')
| -rw-r--r-- | Emby.Server.Implementations/Archiving/ZipClient.cs | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/Emby.Server.Implementations/Archiving/ZipClient.cs b/Emby.Server.Implementations/Archiving/ZipClient.cs index 32938e151..fd61f2617 100644 --- a/Emby.Server.Implementations/Archiving/ZipClient.cs +++ b/Emby.Server.Implementations/Archiving/ZipClient.cs @@ -3,6 +3,7 @@ using MediaBrowser.Model.IO; using SharpCompress.Archives.Rar; using SharpCompress.Archives.SevenZip; using SharpCompress.Archives.Tar; +using SharpCompress.Common; using SharpCompress.Readers; using SharpCompress.Readers.GZip; using SharpCompress.Readers.Zip; @@ -185,44 +186,5 @@ namespace Emby.Server.Implementations.Archiving } } } - - /// <summary> - /// Extracts all from rar. - /// </summary> - /// <param name="sourceFile">The source file.</param> - /// <param name="targetPath">The target path.</param> - /// <param name="overwriteExistingFiles">if set to <c>true</c> [overwrite existing files].</param> - public void ExtractAllFromRar(string sourceFile, string targetPath, bool overwriteExistingFiles) - { - using (var fileStream = _fileSystem.OpenRead(sourceFile)) - { - ExtractAllFromRar(fileStream, targetPath, overwriteExistingFiles); - } - } - - /// <summary> - /// Extracts all from rar. - /// </summary> - /// <param name="source">The source.</param> - /// <param name="targetPath">The target path.</param> - /// <param name="overwriteExistingFiles">if set to <c>true</c> [overwrite existing files].</param> - public void ExtractAllFromRar(Stream source, string targetPath, bool overwriteExistingFiles) - { - using (var archive = RarArchive.Open(source)) - { - using (var reader = archive.ExtractAllEntries()) - { - var options = new ExtractionOptions(); - options.ExtractFullPath = true; - - if (overwriteExistingFiles) - { - options.Overwrite = true; - } - - reader.WriteAllToDirectory(targetPath, options); - } - } - } } } |
