Skip to content

Add host-aware FluentFTP config callback to factories#739

Merged
AndreaCuneo merged 4 commits into
masterfrom
copilot/extend-fluent-ftpclient-library
Jul 1, 2026
Merged

Add host-aware FluentFTP config callback to factories#739
AndreaCuneo merged 4 commits into
masterfrom
copilot/extend-fluent-ftpclient-library

Conversation

Copilot AI commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

FluentFTP client creation could not be customized per target FTP host. This change adds a host-aware configuration callback so callers can mutate FluentFTP.FtpConfig during client construction in both pooled and non-pooled flows.

  • What changed

    • Added overloads to FluentFtpClientFactory and FluentFtpClientPoolFactory accepting:
      Action<string, FluentFTP.FtpConfig>
    • Propagated the callback through FluentFtpClientConnectionFactory into FluentFtpClientConnection.
    • Applied the callback during AsyncFtpClient creation, with the FTP host passed alongside the mutable FluentFTP.FtpConfig.
  • Behavior

    • Configuration can now vary by host without changing shared defaults.
    • The same extension point is available for both direct client creation and pooled connections.
  • API shape

    var factory = new FluentFtpClientFactory((host, config) =>
    {
        if (host == "partner-a.example.com")
        {
            config.SocketKeepAlive = false;
        }
    });
  • Scope

    • Preserves existing constructors and default behavior when no callback is provided.
    • Extends only the FluentFTP-backed implementation; no changes to the core FTP abstractions were required.

Copilot AI and others added 2 commits June 30, 2026 12:19
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Copilot AI changed the title feat(FluentFtp): add host-aware config callback Add host-aware FluentFTP config callback to factories Jun 30, 2026
Copilot AI requested a review from AndreaCuneo June 30, 2026 12:25
Comment thread tests/Ark.Tools.FtpClient.FluentFtp.Tests/FluentFtpClientFactoryTests.cs Outdated
connectionFactoryField.Should().NotBeNull();

var connectionFactory = connectionFactoryField!.GetValue(ftpClientFactory) as IFtpClientConnectionFactory;
connectionFactory.Should().NotBeNull();
Comment thread tests/Ark.Tools.FtpClient.FluentFtp.Tests/FluentFtpClientFactoryTests.cs Outdated
@AndreaCuneo AndreaCuneo marked this pull request as ready for review June 30, 2026 14:19
@AndreaCuneo AndreaCuneo requested a review from a team as a code owner June 30, 2026 14:19
AndreaCuneo and others added 2 commits July 1, 2026 10:37
…null'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Signed-off-by: Andrea Cuneo <kaildio@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Signed-off-by: Andrea Cuneo <kaildio@gmail.com>
@AndreaCuneo AndreaCuneo merged commit 7fbe81b into master Jul 1, 2026
6 of 7 checks passed
@AndreaCuneo AndreaCuneo deleted the copilot/extend-fluent-ftpclient-library branch July 1, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants