COmpletato test GetRemotList x avere elenco file da ripulire...
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"description": "Generate Local Folder Data",
|
||||
"action": "getRemoteList",
|
||||
"paramList": [
|
||||
"ftpdata/syncfolder/*.txt"
|
||||
"ftpdata/syncfolder/",
|
||||
".txt"
|
||||
]
|
||||
},
|
||||
//{
|
||||
|
||||
Reference in New Issue
Block a user