Beispiel #1
0
        public FoldersViewModel GetPathContent(string path)
        {
            var splited = path.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries).ToList();

            if (splited == null || splited.Count == 0)
            {
                return(CreateFolderViewModel(null, "[..]"));
            }
            else
            {
                var depth      = splited.Count;
                var lastFolder = splited.Last();

                var content = _repository.GetFoldersTree(lastFolder, depth);

                var parentNodeId = FindLastFolderIdInTree(splited, content);

                return(CreateFolderViewModel(parentNodeId, lastFolder));
            }
        }