Lucene.Net.Index.BaseIndexFileFormatTestCase.BytesUsedByExtension C# (CSharp) Method

BytesUsedByExtension() private method

private BytesUsedByExtension ( Directory d ) : long>.IDictionary
d Directory
return long>.IDictionary
        private IDictionary<string, long> BytesUsedByExtension(Directory d)
        {
            IDictionary<string, long> bytesUsedByExtension = new Dictionary<string, long>();
            foreach (string file in d.ListAll())
            {
				string ext = IndexFileNames.GetExtension(file) ?? string.Empty;
                long previousLength = bytesUsedByExtension.ContainsKey(ext) ? bytesUsedByExtension[ext] : 0;
                bytesUsedByExtension[ext] = previousLength + d.FileLength(file);
            }
			foreach (string item in ExcludedExtensionsFromByteCounts()) {
				bytesUsedByExtension.Remove(item);							
			}
            return bytesUsedByExtension;
        }