Amazon.KinesisTap.Core/Sources/DirectorySource.cs
/// <summary>
/// Parse filter specification and return a list of filters
/// </summary>
/// <param name="filterSpec">Filter Specification to parse.</param>
/// <returns>An array of filters. Should contain at least 1 or it will throw exception.</returns>
Parse filter specification and return a list of filters
Parse filter specification and return a list of filters
private string[] ParseFilterSpec(string filterSpec)
        {
            string[] filters;
            if (string.IsNullOrWhiteSpace(filterSpec))
            {
                filters = new string[] { "*.*" };
            }
            else
            {
                string[] tempfilters = filterSpec.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                List<string> acceptedFilters = new List<string>();
                foreach(var filter in tempfilters)
                {
                    if (ShouldExclude(filter))
                    {
                        _logger?.LogWarning($"Extension {Path.GetExtension(filter)} is not supported.");
                    }
                    else
                    {
                        acceptedFilters.Add(filter);
                    }
                }
                if (acceptedFilters.Count == 0)
                {
                    throw new ArgumentException("No acceptable filters.");
                }
                filters = acceptedFilters.ToArray();
            }
            return filters;
        }
private string [ ] ParseFilterSpec ( string filterSpec ) { string [ ] filters ; if ( string . IsNullOrWhiteSpace ( filterSpec ) ) { filters = new string [ ] { " " } ; } else { string [ ] tempfilters = filterSpec . Split ( new char [ ] { ' ' } , StringSplitOptions . RemoveEmptyEntries ) ; List < string > acceptedFilters = new List < string > ( ) ; foreach ( var filter in tempfilters ) { if ( ShouldExclude ( filter ) ) { _logger ? . LogWarning ( $" Extension  { Path . GetExtension ( filter ) }  is not supported. " ) ; } else { acceptedFilters . Add ( filter ) ; } } if ( acceptedFilters . Count == 0 ) { throw new ArgumentException ( " " ) ; } filters = acceptedFilters . ToArray ( ) ; } return filters ; }
Parse filter specification and return a list of filters
Parse filter specification and return a list of filters
An array of filters. Should contain at least 1 or it will throw exception.
An array of filters . Should contain at least 1 or it will throw exception .
filterSpec
string
Filter Specification to parse.
Filter Specification to parse .