lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aro...@apache.org
Subject svn commit: r834336 - /incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/FSDirectory.cs
Date Tue, 10 Nov 2009 04:19:39 GMT
Author: aroush
Date: Tue Nov 10 04:19:38 2009
New Revision: 834336

URL: http://svn.apache.org/viewvc?rev=834336&view=rev
Log:
Fixed JUnit test-cases under Store

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/FSDirectory.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/FSDirectory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Store/FSDirectory.cs?rev=834336&r1=834335&r2=834336&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/FSDirectory.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/FSDirectory.cs Tue Nov 10 04:19:38
2009
@@ -171,7 +171,7 @@
 		
 		/// <summary>The default class which implements filesystem-based directories. </summary>
 		// deprecated
-		private static System.Type IMPL;
+		private static readonly System.Type IMPL = typeof(Lucene.Net.Store.FSDirectory);
 		
 		private static System.Security.Cryptography.HashAlgorithm DIGESTER;
 		
@@ -252,7 +252,7 @@
 				{
 					try
 					{
-						dir = (FSDirectory) System.Activator.CreateInstance(IMPL);
+						dir = (FSDirectory) System.Activator.CreateInstance(IMPL, true);
 					}
 					catch (System.Exception e)
 					{
@@ -619,7 +619,13 @@
 				throw new NoSuchDirectoryException("file '" + dir + "' exists but is not a directory");
 			
 			// Exclude subdirs
-            System.String[] result = System.IO.Directory.GetFileSystemEntries(dir.FullName);
+            System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(dir.FullName);
+            System.IO.FileInfo[] files = di.GetFiles();
+            System.String[] result = new System.String[files.Length];
+            for (int i = 0; i < files.Length; i++)
+            {
+                result[i] = files[i].Name;
+            }
 			
 			if (result == null)
 				throw new System.IO.IOException("directory '" + dir + "' exists and is a directory, but
cannot be listed: list() returned null");



Mime
View raw message