public override IEnumerable <string> EnumerateFiles(string relativePath) { if (Directory.Exists(relativePath)) { return(EnumerateFilesForExistingDirectory(relativePath)); } VirtualFileStorageDriver d = CreateDriver(relativePath); if (d != null) { return(d.EnumerateFiles(String.Empty)); } d = FindDriverForPath(relativePath); if (d != null) { return(d.EnumerateFiles(relativePath.Substring(d.RootPath.Length))); } throw new DirectoryNotFoundException(String.Format("Directory not found: {0}", relativePath)); }
public IEnumerable <string> EnumerateFiles(string fullDirectoryPath) { if (String.IsNullOrWhiteSpace(fullDirectoryPath)) { throw new ArgumentException(); } fullDirectoryPath = FileUtil.NormalizePathSeparator(fullDirectoryPath, true); VirtualFileStorageDriver closestDriver = FindClosestDriver(fullDirectoryPath); return(closestDriver.EnumerateFiles(fullDirectoryPath.Substring(closestDriver.RootPath.Length))); }
IEnumerable <string> EnumerateFilesForExistingDirectory(string relativePath) { foreach (string f in Directory.EnumerateFiles(relativePath, "*", SearchOption.AllDirectories)) { yield return(f); VirtualFileStorageDriver d = CreateDriver(f); if (d != null) { foreach (string fInZip in d.EnumerateFiles(String.Empty)) { yield return(fInZip); } } } }