From c02d990ee9ee8b9130357415eaadfd5a00e9f3e7 Mon Sep 17 00:00:00 2001 From: ana-musat Date: Fri, 8 Oct 2021 16:43:20 +0300 Subject: [PATCH 1/6] Add FTP configuration files --- .../FTP/AuthenticationConfiguration.cs | 29 +++++++++++++++++++ .../FTP/FTPCredentialsConfiguration.cs | 14 +++++++++ .../Credentials/FTP/FTPCredentialsManager.cs | 9 ++++++ .../Models/Credentials/FTP/FTPFileTypes.cs | 9 ++++++ .../Credentials/FTP/FTPFilesInformations.cs | 10 +++++++ .../Models/Credentials/FTP/FtpClientTypes.cs | 12 ++++++++ .../Models/Credentials/FTP/IFtpSftpClient.cs | 10 +++++++ 7 files changed, 93 insertions(+) create mode 100644 Ringhel.Procesio.Action.Core/Models/Credentials/FTP/AuthenticationConfiguration.cs create mode 100644 Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPCredentialsConfiguration.cs create mode 100644 Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPCredentialsManager.cs create mode 100644 Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFileTypes.cs create mode 100644 Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFilesInformations.cs create mode 100644 Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FtpClientTypes.cs create mode 100644 Ringhel.Procesio.Action.Core/Models/Credentials/FTP/IFtpSftpClient.cs diff --git a/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/AuthenticationConfiguration.cs b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/AuthenticationConfiguration.cs new file mode 100644 index 0000000..833eecd --- /dev/null +++ b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/AuthenticationConfiguration.cs @@ -0,0 +1,29 @@ +namespace Ringhel.Procesio.Action.Core.Models.Credentials.FTP +{ + public class AuthenticationConfiguration + { + public string UserName { get; set; } + public string Password { get; set; } + public string Key { get; set; } + public string KeyPassphrase { get; set; } + public string KeyUsername { get; set; } + } +} + + + + + + + + + + + + + + + + + + diff --git a/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPCredentialsConfiguration.cs b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPCredentialsConfiguration.cs new file mode 100644 index 0000000..a3c4bb8 --- /dev/null +++ b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPCredentialsConfiguration.cs @@ -0,0 +1,14 @@ +namespace Ringhel.Procesio.Action.Core.Models.Credentials.FTP +{ + public class FTPCredentialsConfiguration + { + public string Host { get; set; } + public int Port { get; set; } + public FtpClientTypes Protocol { get; set; } + public bool IgnoreCertificateWarnings { get; set; } + public string UserName { get; set; } + public string Password { get; set; } + public string Path { get; set; } + public AuthenticationConfiguration Authentication { get; set; } + } +} \ No newline at end of file diff --git a/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPCredentialsManager.cs b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPCredentialsManager.cs new file mode 100644 index 0000000..052f75b --- /dev/null +++ b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPCredentialsManager.cs @@ -0,0 +1,9 @@ +namespace Ringhel.Procesio.Action.Core.Models.Credentials.FTP +{ + public class FTPCredentialsManager + { + public FTPCredentialsConfiguration CredentialsConfiguration { get; set; } + + public IFtpSftpClient Client { get; set; } + } +} \ No newline at end of file diff --git a/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFileTypes.cs b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFileTypes.cs new file mode 100644 index 0000000..06993ce --- /dev/null +++ b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFileTypes.cs @@ -0,0 +1,9 @@ +namespace Ringhel.Procesio.Action.Core.Models.Credentials.FTP +{ + public enum FTPFileTypes + { + Files = 1, + Folders = 2, + FilesAndFolders = 3 + } +} diff --git a/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFilesInformations.cs b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFilesInformations.cs new file mode 100644 index 0000000..c569651 --- /dev/null +++ b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFilesInformations.cs @@ -0,0 +1,10 @@ +namespace Ringhel.Procesio.Action.Core.Models.Credentials.FTP +{ + public class FTPFilesInformations + { + public string Path { get; set; } + public string Name { get; set; } + public string Type { get; set; } + public long Size { get; set; } + } +} diff --git a/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FtpClientTypes.cs b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FtpClientTypes.cs new file mode 100644 index 0000000..edc05e3 --- /dev/null +++ b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FtpClientTypes.cs @@ -0,0 +1,12 @@ +namespace Ringhel.Procesio.Action.Core.Models.Credentials.FTP +{ + /// + /// There are 2 types of FTP clients, + /// can be FTP or SFTP + /// + public enum FtpClientTypes + { + FTP = 1, + SFTP = 2 + } +} \ No newline at end of file diff --git a/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/IFtpSftpClient.cs b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/IFtpSftpClient.cs new file mode 100644 index 0000000..22c5e9e --- /dev/null +++ b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/IFtpSftpClient.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Ringhel.Procesio.Action.Core.Models.Credentials.FTP +{ + public interface IFtpSftpClient + { + Task> ListFileNamesWithinFolder(string path, int recursive, string type); + } +} From eb2ee98bdad5cea89bd07968d552ce298a6d0ac9 Mon Sep 17 00:00:00 2001 From: ana-musat Date: Fri, 8 Oct 2021 17:11:28 +0300 Subject: [PATCH 2/6] Update FTPFileTypes enum --- .../Models/Credentials/FTP/FTPFileTypes.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFileTypes.cs b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFileTypes.cs index 06993ce..96e427a 100644 --- a/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFileTypes.cs +++ b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFileTypes.cs @@ -3,7 +3,6 @@ public enum FTPFileTypes { Files = 1, - Folders = 2, - FilesAndFolders = 3 + Folders = 2 } } From bca924e0fd14b50be86978059cb82c318011de6d Mon Sep 17 00:00:00 2001 From: ana-musat Date: Mon, 11 Oct 2021 14:01:27 +0300 Subject: [PATCH 3/6] Update FTPFileTypes Change isRecursive param type to bool --- .../Models/Credentials/FTP/FTPFileTypes.cs | 4 ++-- .../Models/Credentials/FTP/IFtpSftpClient.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFileTypes.cs b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFileTypes.cs index 96e427a..1a207a8 100644 --- a/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFileTypes.cs +++ b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFileTypes.cs @@ -2,7 +2,7 @@ { public enum FTPFileTypes { - Files = 1, - Folders = 2 + File = 1, + Directory = 2 } } diff --git a/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/IFtpSftpClient.cs b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/IFtpSftpClient.cs index 22c5e9e..e07769d 100644 --- a/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/IFtpSftpClient.cs +++ b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/IFtpSftpClient.cs @@ -5,6 +5,6 @@ namespace Ringhel.Procesio.Action.Core.Models.Credentials.FTP { public interface IFtpSftpClient { - Task> ListFileNamesWithinFolder(string path, int recursive, string type); + Task> ListFileNamesWithinFolder(string directoryPath, bool isRecursive, string type); } } From cb38aff9d69c331e0e8ce26b904e344292972275 Mon Sep 17 00:00:00 2001 From: ana-musat Date: Mon, 11 Oct 2021 18:23:03 +0300 Subject: [PATCH 4/6] Update FTPFileTypes , File to Files and Directory to Folders --- .../Models/Credentials/FTP/FTPFileTypes.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFileTypes.cs b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFileTypes.cs index 1a207a8..96e427a 100644 --- a/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFileTypes.cs +++ b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/FTPFileTypes.cs @@ -2,7 +2,7 @@ { public enum FTPFileTypes { - File = 1, - Directory = 2 + Files = 1, + Folders = 2 } } From c73a0c3e37af7b85f17485735b4d5e24ce7ce13a Mon Sep 17 00:00:00 2001 From: ana-musat Date: Tue, 12 Oct 2021 10:01:58 +0300 Subject: [PATCH 5/6] Add AuthenticationConfiguration class for the FTP --- .../FTP/AuthenticationConfiguration.cs | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/AuthenticationConfiguration.cs b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/AuthenticationConfiguration.cs index 833eecd..950feba 100644 --- a/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/AuthenticationConfiguration.cs +++ b/Ringhel.Procesio.Action.Core/Models/Credentials/FTP/AuthenticationConfiguration.cs @@ -8,22 +8,4 @@ public class AuthenticationConfiguration public string KeyPassphrase { get; set; } public string KeyUsername { get; set; } } -} - - - - - - - - - - - - - - - - - - +} \ No newline at end of file From 6698d231895687442b348fff8be332da957d70a9 Mon Sep 17 00:00:00 2001 From: ana-musat Date: Tue, 12 Oct 2021 10:04:25 +0300 Subject: [PATCH 6/6] Change version to 1.13.1.1 --- .../Ringhel.Procesio.Action.Core.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ringhel.Procesio.Action.Core/Ringhel.Procesio.Action.Core.csproj b/Ringhel.Procesio.Action.Core/Ringhel.Procesio.Action.Core.csproj index d47785e..0d6b6dc 100644 --- a/Ringhel.Procesio.Action.Core/Ringhel.Procesio.Action.Core.csproj +++ b/Ringhel.Procesio.Action.Core/Ringhel.Procesio.Action.Core.csproj @@ -7,7 +7,7 @@ Ringhel Procesio https://github.com/PROCESIO/Action-Core.git - 1.13.0 + 1.13.1.1 Ringhel.Procesio.Action.Core Ringhel.Procesio.Action.Core Ringhel.Procesio.Action.Core