25 namespace Lucene.Net.Support
37 public static System.IO.FileInfo[] GetFiles(System.IO.FileInfo path)
39 if ((path.Attributes & FileAttributes.Directory) > 0)
41 String[] fullpathnames =
Directory.GetFileSystemEntries(path.FullName);
42 System.IO.FileInfo[] result =
new System.IO.FileInfo[fullpathnames.Length];
43 for (
int i = 0; i < result.Length; i++)
44 result[i] =
new System.IO.FileInfo(fullpathnames[i]);
53 public static System.IO.FileInfo[] GetFiles(System.IO.DirectoryInfo path)
55 return GetFiles(
new FileInfo(path.FullName));
64 public static System.String[] GetLuceneIndexFiles(System.String fullName,
65 Index.IndexFileNameFilter indexFileNameFilter)
67 System.IO.DirectoryInfo dInfo =
new System.IO.DirectoryInfo(fullName);
68 System.Collections.ArrayList list =
new System.Collections.ArrayList();
69 foreach (System.IO.FileInfo fInfo in dInfo.GetFiles())
71 if (indexFileNameFilter.Accept(fInfo, fInfo.Name) ==
true)
76 System.String[] retFiles =
new System.String[list.Count];
77 list.CopyTo(retFiles);
83 #pragma warning disable 618
90 public static void Sync(System.IO.FileStream fileStream)
92 if (fileStream == null)
93 throw new ArgumentNullException(
"fileStream");
113 #pragma warning restore 618