Exemplo n.º 1
0
        public IEnumerable <Entry> Search(string path, bool recursive = false)
        {
            try
            {
                // If the path is not absolute let's rebase it on ddbPath
                if (path != null && !Path.IsPathRooted(path))
                {
                    path = Path.Combine(DatasetFolderPath, path);
                }

                // If path is null we use the base ddb path
                path ??= DatasetFolderPath;

                var entries = DDBWrapper.List(DatasetFolderPath, path, recursive);

                if (entries == null)
                {
                    Debug.WriteLine("Strange null return value");
                    return(Array.Empty <Entry>());
                }

                return(entries);
            }
            catch (DDBException ex)
            {
                throw new InvalidOperationException($"Cannot list '{path}' to ddb '{DatasetFolderPath}'", ex);
            }
        }