public virtual void Save(ICrawlerObject obj) { string path = GetLoaclFilePath(obj.CrawlerFileName); JsonSerializerSettings settings = new JsonSerializerSettings() { Formatting = Formatting.Indented, }; var json = JsonConvert.SerializeObject(obj, settings); using (var file = System.IO.File.CreateText(path)) { file.Write(json); file.Flush(); } }
public virtual bool Exist(ICrawlerObject obj) { return(System.IO.File.Exists(GetLoaclFilePath(obj.CrawlerFileName))); }