aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Archiving/ZipClient.cs
diff options
context:
space:
mode:
authorClaus Vium <cvium@users.noreply.github.com>2022-10-11 20:46:31 +0200
committerGitHub <noreply@github.com>2022-10-11 20:46:31 +0200
commita274f4a68814299036fd91e60b47880f5a51a9c6 (patch)
tree1626fd7da50abf0350ab1b644d6699bd39590dd6 /Emby.Server.Implementations/Archiving/ZipClient.cs
parentd50c1b2d4bc0c85428671b288adef1b336da1156 (diff)
parentf789bc948152eeb845b9e5b681cee733a02709b4 (diff)
Merge pull request #7840 from adrez99/gzip
Diffstat (limited to 'Emby.Server.Implementations/Archiving/ZipClient.cs')
-rw-r--r--Emby.Server.Implementations/Archiving/ZipClient.cs46
1 files changed, 0 insertions, 46 deletions
diff --git a/Emby.Server.Implementations/Archiving/ZipClient.cs b/Emby.Server.Implementations/Archiving/ZipClient.cs
deleted file mode 100644
index 6a3b250d2..000000000
--- a/Emby.Server.Implementations/Archiving/ZipClient.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using System.IO;
-using MediaBrowser.Model.IO;
-using SharpCompress.Common;
-using SharpCompress.Readers;
-using SharpCompress.Readers.GZip;
-
-namespace Emby.Server.Implementations.Archiving
-{
- /// <summary>
- /// Class DotNetZipClient.
- /// </summary>
- public class ZipClient : IZipClient
- {
- /// <inheritdoc />
- public void ExtractAllFromGz(Stream source, string targetPath, bool overwriteExistingFiles)
- {
- using var reader = GZipReader.Open(source);
- var options = new ExtractionOptions
- {
- ExtractFullPath = true,
- Overwrite = overwriteExistingFiles
- };
-
- Directory.CreateDirectory(targetPath);
- reader.WriteAllToDirectory(targetPath, options);
- }
-
- /// <inheritdoc />
- public void ExtractFirstFileFromGz(Stream source, string targetPath, string defaultFileName)
- {
- using var reader = GZipReader.Open(source);
- if (reader.MoveToNextEntry())
- {
- var entry = reader.Entry;
-
- var filename = entry.Key;
- if (string.IsNullOrWhiteSpace(filename))
- {
- filename = defaultFileName;
- }
-
- reader.WriteEntryToFile(Path.Combine(targetPath, filename));
- }
- }
- }
-}