// Copyright (c) 2026 Duplicati Inc. All rights reserved. using Duplicati.Library.Interface; using Duplicati.Library.Utility; using Duplicati.Proprietary.LicenseChecker; namespace Duplicati.Proprietary.LoaderHelper; /// /// Shared list of statically linked web modules /// public static class WebModules { /// /// The list of all built-in web modules /// public static IReadOnlyList LicensedWebModules { get { // Safegard against errors during loading, e.g. missing libraries try { return LicensedWebModulesLazy.Value; } catch { return Array.Empty(); } } } /// /// Calculate list once and cache it /// private static Lazy> LicensedWebModulesLazy = new(() => new IWebModule?[] { LicenseHelper.IsOffice365Enabled ? new Office365.WebModule() : null, LicenseHelper.IsGoogleWorkspaceEnabled ? new GoogleWorkspace.WebModule() : null, new DiskImage.WebModule() } .WhereNotNull() .ToList() ); }