wabbajack/Wabbajack.Lib/Downloaders/AbstractDownloadState.cs

40 lines
1.2 KiB
C#
Raw Normal View History

using Alphaleonis.Win32.Filesystem;
using Wabbajack.Lib.Validation;
2019-10-12 18:03:45 +00:00
namespace Wabbajack.Lib.Downloaders
2019-10-12 18:03:45 +00:00
{
/// <summary>
/// Base for all abstract downloaders
/// </summary>
public abstract class AbstractDownloadState
{
/// <summary>
/// Returns true if this file is allowed to be downloaded via whitelist
/// </summary>
/// <param name="whitelist"></param>
/// <returns></returns>
public abstract bool IsWhitelisted(ServerWhitelist whitelist);
/// <summary>
/// Downloads this file to the given destination location
/// </summary>
/// <param name="destination"></param>
public abstract void Download(Archive a, string destination);
public void Download(string destination)
{
Download(new Archive {Name = Path.GetFileName(destination)}, destination);
}
2019-10-12 18:03:45 +00:00
/// <summary>
/// Returns true if this link is still valid
/// </summary>
/// <returns></returns>
public abstract bool Verify();
public abstract IDownloader GetDownloader();
public abstract string GetReportEntry(Archive a);
2019-10-12 18:03:45 +00:00
}
}