/// <summary>
 /// Constructor
 /// </summary>
 /// <param name="service">Service</param>
 /// <param name="textFilePathMask">Path / mask to text file to ban ip addresses from</param>
 public IPBanBlockIPAddressesUpdater(IIPAddressEventHandler service, string textFilePathMask)
 {
     service.ThrowIfNull();
     this.service          = service;
     this.textFilePathDir  = Path.GetDirectoryName(textFilePathMask);
     this.textFilePathMask = Path.GetFileName(textFilePathMask);
 }
 /// <summary>
 /// Create a log file scanner
 /// </summary>
 /// <param name="loginHandler">Interface for handling logins</param>
 /// <param name="dns">Interface for dns lookup</param>
 /// <param name="source">The source, i.e. SSH or SMTP, etc.</param>
 /// <param name="pathAndMask">File path and mask (i.e. /var/log/auth*.log)</param>
 /// <param name="recursive">Whether to parse all sub directories of path and mask recursively</param>
 /// <param name="regexFailure">Regex to parse file lines to pull out failed login ipaddress and username</param>
 /// <param name="regexSuccess">Regex to parse file lines to pull out successful login ipaddress and username</param>
 /// <param name="maxFileSizeBytes">Max size of file (in bytes) before it is deleted or 0 for unlimited</param>
 /// <param name="pingIntervalMilliseconds">Ping interval in milliseconds, less than 1 for manual ping required</param>
 public IPBanIPAddressLogFileScanner
 (
     IIPAddressEventHandler loginHandler,
     IDnsLookup dns,
     string source,
     string pathAndMask,
     bool recursive,
     string regexFailure,
     string regexSuccess,
     long maxFileSizeBytes        = 0,
     int pingIntervalMilliseconds = 0
 ) : base(pathAndMask, recursive, maxFileSizeBytes, pingIntervalMilliseconds)
 {
     loginHandler.ThrowIfNull(nameof(loginHandler));
     dns.ThrowIfNull(nameof(dns));
     Source            = source;
     this.loginHandler = loginHandler;
     this.dns          = dns;
     this.regexFailure = IPBanConfig.ParseRegex(regexFailure);
     this.regexSuccess = IPBanConfig.ParseRegex(regexSuccess);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="service">Service</param>
 /// <param name="textFilePath">Path to text file to ban ip addresses from</param>
 public IPBanBlockIPAddressesUpdater(IIPAddressEventHandler service, string textFilePath)
 {
     service.ThrowIfNull();
     this.service      = service;
     this.textFilePath = textFilePath;
 }