COmpletato test GetRemotList x avere elenco file da ripulire...

This commit is contained in:
Samuele Locatelli
2024-10-08 15:35:51 +02:00
parent 94fc764558
commit ae77cdbf7e
2 changed files with 19 additions and 6 deletions
+17 -5
View File
@@ -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<FluentFTP.FtpListItem> resList = ftpClient.GetRemoteList(remoteDir, true);
// cerco solo i file di tipo fileSearch
List<FluentFTP.FtpListItem> resListFilt = new List<FluentFTP.FtpListItem>();
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:
+2 -1
View File
@@ -10,7 +10,8 @@
"description": "Generate Local Folder Data",
"action": "getRemoteList",
"paramList": [
"ftpdata/syncfolder/*.txt"
"ftpdata/syncfolder/",
".txt"
]
},
//{