mlaumcherb/Млаумчерб.Клиент/сеть/NetworkTaskFactories/JavaDownloadTaskFactory.cs
2024-09-29 08:21:48 +05:00

46 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Security.Cryptography;
using Млаумчерб.Клиент.классы;
using static Млаумчерб.Клиент.сеть.Сеть;
namespace Млаумчерб.Клиент.сеть.NetworkTaskFactories;
public class JavaDownloadTaskFactory : INetworkTaskFactory
{
private VersionDescriptor _descriptor;
private SHA1 _hasher;
IOPath _javaVersionDir;
public JavaDownloadTaskFactory(VersionDescriptor descriptor)
{
_descriptor = descriptor;
_hasher = SHA1.Create();
_javaVersionDir = Пути.GetJavaRuntimeDir(_descriptor.javaVersion.component);
}
public Task<NetworkTask?> CreateAsync(bool checkHashes)
{
NetworkTask? networkTask = null;
if (!CheckFiles(checkHashes))
networkTask = new(
$"java runtime '{_descriptor.javaVersion.component}'",
GetTotalSize(),
Download
);
return Task.FromResult(networkTask);
}
private bool CheckFiles(bool checkHashes)
{
throw new NotImplementedException();
}
private long GetTotalSize()
{
throw new NotImplementedException();
}
private Task Download(NetworkProgressReporter pr, CancellationToken ct)
{
throw new NotImplementedException();
}
}