/// <summary>
/// Clones FTP session used by file watcher so it can be used for other purposes.
/// </summary>
/// <returns>New connected FTP session matching settings defined for FTP file watcher.</returns>
public virtual FtpClient CloneFtpSession()
{
// This method is just for convenience. We can't allow the end user to use the
// actual internal directory for sending files or other work because it is
// constantly being refreshed/used etc., so we instead create a new FTP Session
// based on the current internal session and watch directory information
FtpClient newSession = new FtpClient(m_session.CaseInsensitive);
newSession.Server = m_session.Server;
newSession.Connect(m_username, m_password);
newSession.SetCurrentDirectory(m_watchDirectory);
return newSession;
}