tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
ZipStreamEngineInstallationData.cs
Go to the documentation of this file.
1using System;
2using System.IO;
3using System.Threading;
4using System.Threading.Tasks;
5
7
9{
14 {
19
23 readonly Stream zipStream;
24
31 {
32 this.ioManager = ioManager ?? throw new ArgumentNullException(nameof(ioManager));
33 this.zipStream = zipStream ?? throw new ArgumentNullException(nameof(zipStream));
34 }
35
37 public ValueTask DisposeAsync() => zipStream.DisposeAsync();
38
40 public Task ExtractToPath(string path, CancellationToken cancellationToken)
41 => ioManager.ZipToDirectory(path, zipStream, cancellationToken);
42 }
43}
Implementation of IEngineInstallationData for a zip file in a Stream.
readonly Stream zipStream
The MemoryStream containing the zip data of the engine.
Task ExtractToPath(string path, CancellationToken cancellationToken)
Extracts the installation to a given path.A Task representing the running operation.
readonly IIOManager ioManager
The IIOManager for the ZipStreamEngineInstallationData.
ZipStreamEngineInstallationData(IIOManager ioManager, Stream zipStream)
Initializes a new instance of the ZipStreamEngineInstallationData class.
Interface for using filesystems.
Definition IIOManager.cs:13
Task ZipToDirectory(string path, Stream zipFile, CancellationToken cancellationToken)
Extract a set of zipFile to a given path .