Files
BeWoPlaner/BeWoLauncher/Logic/Controller/DownloadController.cs
rene 4fbfdbaf2c Unit Tests erstellt
Informationen ausgelagert
Kleines Spy/Test Programm erstellt
Mehr Exceptions/InvalidUpdateFileRequestException.cs
Launcher Host in Download Server geändert
Download Server macht zusätzlich Abfrage an den Hauptserver
Download geht jetzt stückweise von statten
2022-12-28 16:36:59 +01:00

36 lines
1.0 KiB
C#

using BeWoLauncher.Logic.Utils;
using BeWoLauncher.Logic.Utils.Download;
using BS.SharedLauncher.Information;
using BS.SharedLauncher.Utils;
using System.IO;
namespace BeWoLauncher.Logic.Controller
{
public static class DownloadController
{
public static DownloadManager Manager { get; set; }
public static long FreeSpace { get; set; }
public static long NeededSpace => Manager.UpdatePlanResponse.DownloadSize;
public static void Start()
{
Manager = new DownloadManager();
DownloadLogger.Init(LauncherPaths.GetLoggerPath());
}
public static string UpdateDiskSpace(string path)
{
FileInfo f = new FileInfo(path);
string drive = System.IO.Path.GetPathRoot(f.FullName);
FreeSpace = NonspecificTools.GetTotalFreeSpace(drive);
if (FreeSpace >= 0)
return NonspecificTools.SizeSuffix((ulong)FreeSpace);
else
return "error";
}
}
}