public FileResponse Get(FileRequest request) { string path = GetPath(request.Path); // See if it's a folder Manager manager = new Manager(base.Db, Config.RootDirectory); Models.Folder folder = manager.GetFolder(path); if (folder != null) { IEnumerable<Models.Folder> folders = null; IEnumerable<Models.File> files = null; manager.GetChildren(folder, out folders, out files); FileResponse response = new FileResponse(); response.Directory = FolderResult.Create(folders, files); return response; } return new FileResponse(); }
public void Initialize() { IDbConnection conn = GlobalInit.dbFactory.CreateDbConnection(); conn.Open(); manager = new Manager(conn, GlobalInit.rootFolder); Assert.IsNotNull(manager); root = manager.GetFolder("/"); }