tgstation-server 6.19.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 ValueTask ExtractToPath(string path, CancellationToken cancellationToken)
41 => ioManager.ZipToDirectory(path, zipStream, cancellationToken);
42 }
43}
Implementation of IEngineInstallationData for a zip file in a Stream.
ValueTask ExtractToPath(string path, CancellationToken cancellationToken)
Extracts the installation to a given path.A ValueTask representing the running operation.
readonly Stream zipStream
The Stream containing the zip data of the engine.
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:14
ValueTask ZipToDirectory(string path, Stream zipFile, CancellationToken cancellationToken)
Extract a set of zipFile to a given path .