aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Integrations/FTP/FTPClientFactory.cs
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-06-29 22:14:57 -0500
committerJP Dillingham <jpdillingham@gmail.com>2021-06-29 22:14:57 -0500
commite141476ef5b6e13ec8de6cfe0d599595326ed28f (patch)
tree0eecaf2de35fce81963380209eb9636c3c9c23eb /src/slskd/Integrations/FTP/FTPClientFactory.cs
parent3093c4ad7362809deb1de2a98b36a0390d08e44b (diff)
downloadslskd-e141476ef5b6e13ec8de6cfe0d599595326ed28f.tar.gz
cleanup
Diffstat (limited to 'src/slskd/Integrations/FTP/FTPClientFactory.cs')
-rw-r--r--src/slskd/Integrations/FTP/FTPClientFactory.cs20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/slskd/Integrations/FTP/FTPClientFactory.cs b/src/slskd/Integrations/FTP/FTPClientFactory.cs
index 887623a2..7e6f948e 100644
--- a/src/slskd/Integrations/FTP/FTPClientFactory.cs
+++ b/src/slskd/Integrations/FTP/FTPClientFactory.cs
@@ -21,8 +21,15 @@ namespace slskd.Integrations.FTP
using FluentFTP;
using static slskd.Options.IntegrationOptions;
+ /// <summary>
+ /// FTP client factory.
+ /// </summary>
public class FTPClientFactory : IFTPClientFactory
{
+ /// <summary>
+ /// Initializes a new instance of the <see cref="FTPClientFactory"/> class.
+ /// </summary>
+ /// <param name="optionsMonitor">The options monitor used to derive application options.</param>
public FTPClientFactory(Microsoft.Extensions.Options.IOptionsMonitor<Options> optionsMonitor)
{
Options = optionsMonitor.CurrentValue;
@@ -33,15 +40,20 @@ namespace slskd.Integrations.FTP
}
catch (Exception ex)
{
- // Options should validate that the given string is parsable to FtpEncryptionMode through EnumAttribute; if this throws there's a bug somewhere.
+ // Options should validate that the given string is parsable to FtpEncryptionMode through EnumAttribute; if this
+ // throws there's a bug somewhere.
throw new ArgumentException($"Failed to parse {typeof(FtpEncryptionMode).Name} from application Options. This is most likely a programming error; please file a GitHub issue and include your FTP configuration.", ex);
}
}
- private Options Options { get; set; }
- private FTPOptions FTPOptions => Options.Integration.FTP;
private FtpEncryptionMode EncryptionMode { get; set; }
+ private FTPOptions FTPOptions => Options.Integration.FTP;
+ private Options Options { get; set; }
+ /// <summary>
+ /// Creates an instance of <see cref="FtpClient"/>.
+ /// </summary>
+ /// <returns>The created instance.</returns>
public FtpClient CreateFtpClient()
{
var client = new FtpClient(FTPOptions.Address, FTPOptions.Port, FTPOptions.Username, FTPOptions.Password);
@@ -50,4 +62,4 @@ namespace slskd.Integrations.FTP
return client;
}
}
-}
+} \ No newline at end of file