void CopyToServices(Magnum.FileSystem.Directory obj) { string serviceName = obj.Name.GetName(); Magnum.FileSystem.Directory targetDir = _fs.GetDirectory("Services").GetChildDirectory(serviceName); obj.CopyTo(targetDir.Name); }
public void Start() { //TODO: how to find the services dir //TODO: how to get the bottles dir //TODO: do we need a custom config? string baseDir = ConfigurationManager.AppSettings["BottlesDirectory"] ?? Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Bottles"); _fs = new DotNetFileSystem(); Magnum.FileSystem.Directory bottlesDir = _fs.GetDirectory(baseDir); _watcher = new BottleWatcher(); _cleanup = _watcher.Watch(bottlesDir.Name.GetPath(), CopyToServices); }