diff --git a/Duplicati/Library/Interface/ICommonModule.cs b/Duplicati/Library/Interface/ICommonModule.cs new file mode 100644 index 000000000..ffecfe172 --- /dev/null +++ b/Duplicati/Library/Interface/ICommonModule.cs @@ -0,0 +1,17 @@ +namespace Duplicati.Library.Interface; + +public interface ICommonModule : IDynamicModule +{ + /// + /// Gets the module key + /// + string Key { get; } + /// + /// Gets the display name of the module + /// + string DisplayName { get; } + /// + /// Gets the description of the module + /// + string Description { get; } +} diff --git a/Duplicati/Library/Interface/IFolderEnabledBackend.cs b/Duplicati/Library/Interface/IFolderEnabledBackend.cs index 6f9374aed..2774a388c 100644 --- a/Duplicati/Library/Interface/IFolderEnabledBackend.cs +++ b/Duplicati/Library/Interface/IFolderEnabledBackend.cs @@ -28,9 +28,8 @@ using System.Threading.Tasks; namespace Duplicati.Library.Interface; /// -/// An interface a backend may implement if it supports streaming operations. -/// Backends that implement this interface can be throttled and correctly shows -/// the progressbar when transferring data. +/// An interface for backends that support folder operations. +/// Backends that implement this interface can be used as sources for data. /// public interface IFolderEnabledBackend : IBackend { diff --git a/Duplicati/Library/Interface/IGenericModule.cs b/Duplicati/Library/Interface/IGenericModule.cs index f18e463cd..d6e3fe308 100644 --- a/Duplicati/Library/Interface/IGenericModule.cs +++ b/Duplicati/Library/Interface/IGenericModule.cs @@ -1,22 +1,22 @@ -// Copyright (C) 2025, The Duplicati Team -// https://duplicati.com, hello@duplicati.com -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// Copyright (C) 2025, The Duplicati Team +// https://duplicati.com, hello@duplicati.com +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. using System.Collections.Generic; @@ -34,23 +34,8 @@ namespace Duplicati.Library.Interface /// All instances where the Configure method is called will be disposed, /// if they implement the IDisposable interface as well. /// - public interface IGenericModule : IDynamicModule + public interface IGenericModule : ICommonModule { - /// - /// The module key, used to activate or deactivate the module on the commandline - /// - string Key { get; } - - /// - /// A localized string describing the module with a friendly name - /// - string DisplayName { get; } - - /// - /// A localized description of the module - /// - string Description { get; } - /// /// A boolean value that indicates if the module should always be loaded. /// If true, the user can choose to not load the module by entering the appropriate commandline option. diff --git a/Duplicati/Library/Interface/ISecretProvider.cs b/Duplicati/Library/Interface/ISecretProvider.cs index 2aa5e3d78..2595f1db1 100644 --- a/Duplicati/Library/Interface/ISecretProvider.cs +++ b/Duplicati/Library/Interface/ISecretProvider.cs @@ -29,7 +29,7 @@ namespace Duplicati.Library.Interface; /// /// Interface for secret providers /// -public interface ISecretProvider : IDynamicModule +public interface ISecretProvider : ICommonModule { // abstract static Task CreateAsync(string config, CancellationToken cancellationToken) // where T : ISecretProvider; @@ -57,10 +57,6 @@ public interface ISecretProvider : IDynamicModule /// The cancellation token. Task SetSecretAsync(string key, string value, bool overwrite, CancellationToken cancellationToken); /// - /// The key for the secret provider - /// - string Key { get; } - /// /// Indicates whether the secret provider is supported on the current platform. /// /// The cancellation token. @@ -69,12 +65,4 @@ public interface ISecretProvider : IDynamicModule /// Indicates whether the secret provider supports setting secrets. /// bool IsSetSupported { get; } - /// - /// The display name of the secret provider - /// - string DisplayName { get; } - /// - /// The description of the secret provider - /// - string Description { get; } } diff --git a/Duplicati/Library/Interface/ISnapshotService.cs b/Duplicati/Library/Interface/ISnapshotService.cs index 9149615b2..3cf79fc8b 100644 --- a/Duplicati/Library/Interface/ISnapshotService.cs +++ b/Duplicati/Library/Interface/ISnapshotService.cs @@ -114,7 +114,7 @@ public interface ISnapshotService : IDisposable /// The metadata for the given file or folder /// The file or folder to examine /// A flag indicating if the target is a symlink - Dictionary GetMetadata(string localPath, bool isSymlink); + Dictionary GetMetadata(string localPath, bool isSymlink); /// /// Gets a value indicating if the path points to a block device diff --git a/Duplicati/Library/Interface/ISourceProviderModule.cs b/Duplicati/Library/Interface/ISourceProviderModule.cs index 469db1fb0..d9c5dc297 100644 --- a/Duplicati/Library/Interface/ISourceProviderModule.cs +++ b/Duplicati/Library/Interface/ISourceProviderModule.cs @@ -26,14 +26,6 @@ namespace Duplicati.Library.Interface; /// /// Implements a data source that can be backed up /// -public interface ISourceProviderModule : ISourceProvider, IDynamicModule +public interface ISourceProviderModule : ISourceProvider, ICommonModule { - /// - /// Gets the module key - /// - string Key { get; } - /// - /// Gets the display name of the module - /// - string DisplayName { get; } }