public void Start() { _collector = UpdateInfoCollectorFactory.GetCollector(); _installDir = ConfigurationManager.AppSettings["Asimov.InstallDir"]; _timer = new Timer(TimerTick, null, 0, interval); }
public static IUpdateInfoCollector GetCollector() { var watchFolder = ConfigurationManager.AppSettings["Asimov.WatchFolder"]; var port = Int32.Parse(ConfigurationManager.AppSettings["Asimov.WebPort"]); var googleStoragePattern = new Regex(@"(gs:)//", RegexOptions.IgnoreCase); var useGoogleStorage = googleStoragePattern.Match(watchFolder); IUpdateInfoCollector collector = useGoogleStorage.Success ? GetGoogleStorageCollector(watchFolder, port) : GetFileUpdateInfoCollector(watchFolder, port); return(collector); }