private TextReader GetTextReader <T>(string feedPath) { string fileName = SupportedFileNames.GetFileNameByType <T>(); var testFilePath = Path.Combine(feedPath, fileName); if (!File.Exists(testFilePath)) { return(new StringReader(String.Empty)); } return(File.OpenText(testFilePath)); }
private void SetValidity <T>(HashSet <T> collection) where T : Entity { if (collection.Count > 0 && IsValid) { IsValid = collection.Count >= 1; } else { UnparsedFiles.Add(SupportedFileNames.GetFileNameByType <T>()); IsValid = false; } }
private TextReader GetTextReader <T>() { string fileName = SupportedFileNames.GetFileNameByType <T>(); if (_zipData == null) { var testFilePath = Path.Combine(_feedPath, fileName); if (!File.Exists(testFilePath)) { return(new StringReader(String.Empty)); } return(File.OpenText(testFilePath)); } var zipFile = _zipData.Entries.FirstOrDefault(f => f.Name == fileName); if (zipFile == null) { return(new StringReader(String.Empty)); } return(new StreamReader(zipFile.Open())); }
private IEntityParser <IEntity> GetEntityParser <T>() { return(new EntityParserFactory().Create( SupportedFileNames.GetFileNameByType <T>())); }