Beispiel #1
0
        public string[] GetFiles(string path)
        {
            if (!IsValidPath(path))
            {
                return(new string[0]);
            }

            int pathsCount = path.Split('/').Length;

            if (path == "/")
            {
                pathsCount = 1;
            }

            StringCollection result = new StringCollection();

            for (int i = 0; i < _files.Count; i++)
            {
                if (_files[i].StartsWith(path) && _files[i].Split('/').Length == (pathsCount + 1))
                {
                    result.Add(_files[i]);
                }
            }
            return(result.GetItems());
        }
Beispiel #2
0
        public string[] GetAllFiles()
        {
            //StringCollection sc = new StringCollection();
            //foreach (ZipEntry ze in _zip)
            //{
            //    if (ze.IsFile)
            //    {
            //        sc.Add("/" + ze.Name);
            //    }
            //}
            //sc.Sort();
            //return sc.GetItems();

            return(_files.GetItems());
        }
Beispiel #3
0
        public string[] GetFiles(string path)
        {
            if (!IsValidPath(path)) return new string[0];

            int pathsCount = path.Split('/').Length;
            if (path == "/") pathsCount = 1;

            StringCollection result = new StringCollection();
            for (int i = 0; i < _files.Count; i++)
            {
                if (_files[i].StartsWith(path) && _files[i].Split('/').Length == (pathsCount + 1))
                {
                    result.Add(_files[i]);
                }
            }
            return result.GetItems();
        }