diff --git a/EgwProxy.Ftp.Test/Program.cs b/EgwProxy.Ftp.Test/Program.cs index d09e42a2..13207ec9 100644 --- a/EgwProxy.Ftp.Test/Program.cs +++ b/EgwProxy.Ftp.Test/Program.cs @@ -1,5 +1,6 @@ using Newtonsoft.Json; using System; +using System.Collections.Generic; using System.Configuration; using System.Diagnostics; using System.IO; @@ -375,14 +376,25 @@ namespace EgwProxy.Ftp.Test break; case stepType.getRemoteList: - if (item.paramList != null && item.paramList.Count > 0) + if (item.paramList != null && item.paramList.Count > 1) { sw.Restart(); string remoteDir = item.paramList[0]; - var resList = ftpClient.GetRemoteList(remoteDir, true); - if (resList.Count>0) + string fileSearch= item.paramList[1]; + List resList = ftpClient.GetRemoteList(remoteDir, true); + // cerco solo i file di tipo fileSearch + List resListFilt = new List(); + foreach (var flItem in resList) { - esitoStep = $"Trovati {resList.Count} file"; + if(flItem.Type == FluentFTP.FtpObjectType.File && flItem.Name.Contains(fileSearch)) + { + resListFilt.Add(flItem); + } + } + + if (resListFilt.Count>0) + { + esitoStep = $"Trovati {resListFilt.Count} file"; } else { @@ -394,7 +406,7 @@ namespace EgwProxy.Ftp.Test esitoStep = "Error: missing parameters!"; } sw.Stop(); - esitoStep = $"Completato GetRemotList : {sw.ElapsedMilliseconds:N1} ms"; + esitoStep += $"{Environment.NewLine}Completato GetRemotList : {sw.ElapsedMilliseconds:N1} ms"; break; default: diff --git a/EgwProxy.Ftp.Test/conf/testSetup.json b/EgwProxy.Ftp.Test/conf/testSetup.json index be77281d..d5c003ad 100644 --- a/EgwProxy.Ftp.Test/conf/testSetup.json +++ b/EgwProxy.Ftp.Test/conf/testSetup.json @@ -10,7 +10,8 @@ "description": "Generate Local Folder Data", "action": "getRemoteList", "paramList": [ - "ftpdata/syncfolder/*.txt" + "ftpdata/syncfolder/", + ".txt" ] }, //{