lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject lucenenet git commit: Removing GetCanonicalPath to match Lucene logic of not creating the directory first
Date Fri, 20 Mar 2015 12:11:23 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master dc71f60de -> 464fd5054


Removing GetCanonicalPath to match Lucene logic of not creating the directory first

Fixes #117 and closes #70

Related:
https://github.com/guidotag/lucenenet/commit/6137a84724a5424cb19aee261a6415a88fd839c2
https://github.com/laimis/lucenenet/commit/46b3b794dca8a035e7c751574b931449c5502316


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/464fd505
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/464fd505
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/464fd505

Branch: refs/heads/master
Commit: 464fd5054e8fab75d022cfcf5ea09f9d98bcfb6c
Parents: dc71f60
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Fri Mar 20 14:11:06 2015 +0200
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Fri Mar 20 14:11:06 2015 +0200

----------------------------------------------------------------------
 src/Lucene.Net.Core/Store/FSDirectory.cs | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/464fd505/src/Lucene.Net.Core/Store/FSDirectory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/FSDirectory.cs b/src/Lucene.Net.Core/Store/FSDirectory.cs
index 0eb6c3f..660cc4e 100644
--- a/src/Lucene.Net.Core/Store/FSDirectory.cs
+++ b/src/Lucene.Net.Core/Store/FSDirectory.cs
@@ -118,21 +118,6 @@ namespace Lucene.Net.Store
         protected internal readonly ISet<string> StaleFiles = new HashSet<string>();
// Files written, but not yet sync'ed
         private int ChunkSize = DEFAULT_READ_CHUNK_SIZE;
 
-        // returns the canonical version of the directory, creating it if it doesn't exist.
-        private static DirectoryInfo GetCanonicalPath(DirectoryInfo file)
-        {
-            try
-            {
-                file.Create();
-            }
-            catch (IOException)
-            {
-                //File already exists
-            }
-
-            return file;
-        }
-
         protected FSDirectory(DirectoryInfo dir)
             : this(dir, null)
         {
@@ -151,7 +136,7 @@ namespace Lucene.Net.Store
             {
                 lockFactory = new NativeFSLockFactory();
             }
-            directory = GetCanonicalPath(path);
+            directory = path; // Lucene.NET doesn't need to call GetCanonicalPath since we
already have DirectoryInfo handy
 
             if (File.Exists(path.FullName))
             {


Mime
View raw message