Skip to content

Commit

Permalink
detect titan ftp server
Browse files Browse the repository at this point in the history
  • Loading branch information
robinrodricks committed Feb 6, 2022
1 parent f612b63 commit 4dfab36
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
5 changes: 5 additions & 0 deletions FluentFTP/Enums/FtpServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,10 @@ public enum FtpServer {
/// Definitely PyFtpdLib server
/// </summary>
PyFtpdLib,

/// <summary>
/// Definitely Titan FTP server
/// </summary>
TitanFTP,
}
}
1 change: 1 addition & 0 deletions FluentFTP/Servers/FtpServerSpecificHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ internal static class FtpServerSpecificHandler {
new WSFTPServer(),
new WuFtpdServer(),
new XLightServer(),
new TitanFtpServer()
};

#region Working Connection Profiles
Expand Down
43 changes: 43 additions & 0 deletions FluentFTP/Servers/Handlers/TitanFtpServer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using System.Security.Authentication;
using FluentFTP;
using FluentFTP.Servers;
#if (CORE || NETFX)
using System.Threading;
#endif
#if ASYNC
using System.Threading.Tasks;
#endif

namespace FluentFTP.Servers.Handlers {

/// <summary>
/// Server-specific handling for Titan FTP servers
/// </summary>
public class TitanFtpServer : FtpBaseServer {

/// <summary>
/// Return the FtpServer enum value corresponding to your server, or Unknown if its a custom implementation.
/// </summary>
public override FtpServer ToEnum() {
return FtpServer.TitanFTP;
}

/// <summary>
/// Return true if your server is detected by the given FTP server welcome message.
/// </summary>
public override bool DetectByWelcome(string message) {

// Detect Pure-FTPd server
// Welcome message: "220 Titan FTP Server 10.01.1740 Ready"
if (message.Contains("Titan FTP")) {
return true;
}

return false;
}

}
}

0 comments on commit 4dfab36

Please sign in to comment.