2026-01-14 10:22:46 +01:00
|
|
|
// Copyright (c) 2026 Duplicati Inc. All rights reserved.
|
|
|
|
|
|
|
|
|
|
using Duplicati.Library.Interface;
|
|
|
|
|
using Duplicati.Library.Utility;
|
2026-01-20 10:36:37 +01:00
|
|
|
using Duplicati.Proprietary.LicenseChecker;
|
2026-01-14 10:22:46 +01:00
|
|
|
|
|
|
|
|
namespace Duplicati.Proprietary.LoaderHelper;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Shared list of statically linked source-provider modules
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static class SourceProviderModules
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The list of all built-in source-provider modules
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static IReadOnlyList<ISourceProviderModule> LicensedSourceProviderModules
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
// Safegard against errors during loading, e.g. missing libraries
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
return LicensedSourceProvidersLazy.Value;
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
return Array.Empty<ISourceProviderModule>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Calculate list once and cache it
|
|
|
|
|
/// </summary>
|
|
|
|
|
private static Lazy<IReadOnlyList<ISourceProviderModule>> LicensedSourceProvidersLazy = new(() =>
|
|
|
|
|
new ISourceProviderModule?[] {
|
2026-02-15 16:42:08 +01:00
|
|
|
LicenseHelper.IsOffice365Enabled ? new Office365.SourceProvider() : null,
|
2026-02-20 10:46:40 +01:00
|
|
|
LicenseHelper.IsGoogleWorkspaceEnabled ? new GoogleWorkspace.SourceProvider() : null,
|
2026-02-05 11:15:12 +01:00
|
|
|
new DiskImage.SourceProvider()
|
2026-01-14 10:22:46 +01:00
|
|
|
}
|
|
|
|
|
.WhereNotNull()
|
|
|
|
|
.ToList()
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|