public string[] GetFileEntries(string path, string searchPattern)
{
//TODO:Ignoring searchPattern for the moment
if (searchPattern != "*")
throw new NotImplementedException("Search patterns other than * are not yet implemented");
var found = new List<string>();
if (IsRoot(path))
{
foreach (ZipEntry entry in _storage.Entries.Where(entry => entry.IsDirectory == false && VirtualFileUtils.IsTopLevel(entry.FileName)))
{
found.Add(GetFullName(entry.FileName));
}
return found.ToArray();
}
foreach (ZipEntry entry in _storage.Entries)
{
if (entry.IsDirectory)
continue;
string normalizedFile = VirtualFileUtils.NormalizePath(entry.FileName);
string directory = VirtualFileUtils.NormalizePath(Path.GetDirectoryName(normalizedFile));
string target = RemoveRoot(path);
if (String.Compare(target, directory, true) == 0)
found.Add(GetFullName(normalizedFile));
}
return found.ToArray();
}