If I can help :
This is how it can be done :
Regexp construction pattern : see PJ
Loop on file return by
ListDirectory
with a new parameter pattern
RemoteDirectoryInfo v_RemoteDirectoryInfo = session.ListDirectory(path);
Regex v_Regex = FTPClientBeanCommandFTP.FindFilesPatternToRegex.Convert(pattern);
List<RemoteFileInfo> v_ListFile = new List<RemoteFileInfo>();
foreach (RemoteFileInfo v_RemoteFileInfo in v_RemoteDirectoryInfo.Files)
{
if ((!v_RemoteFileInfo.IsDirectory)
&& (v_Regex.IsMatch(v_RemoteFileInfo.Name)))
{
v_ListFile.Add(v_RemoteFileInfo);
}
}
// This can not be done because ".Files" is read only
v_RemoteDirectoryInfo.Files.Clear();
foreach (RemoteFileInfo v_RemoteFileInfo in v_ListFile)
{
v_RemoteDirectoryInfo.Files.Add(v_RemoteFileInfo);
}
So it can be call like this :
RemoteDirectoryInfo v_RemoteDirectoryInfo = session.ListDirectory("/TestFTP", "*.CSV");