lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [1/2] lucenenet git commit: Rename
Date Wed, 31 Dec 2014 21:33:07 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master 355f09dad -> 4128cedfe


Rename


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

Branch: refs/heads/master
Commit: f3a5a564f1e69e29b4ee0fe88ede0f4969c9e637
Parents: 355f09d
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Wed Dec 31 23:21:49 2014 +0200
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Wed Dec 31 23:21:49 2014 +0200

----------------------------------------------------------------------
 src/Lucene.Net.Core/Store/FSDirectory.cs | 40 +++++++++++++--------------
 1 file changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f3a5a564/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 aaa278f..25c5c1e 100644
--- a/src/Lucene.Net.Core/Store/FSDirectory.cs
+++ b/src/Lucene.Net.Core/Store/FSDirectory.cs
@@ -114,7 +114,7 @@ namespace Lucene.Net.Store
         [Obsolete("this constant is no longer used since Lucene 4.5.")]
         public const int DEFAULT_READ_CHUNK_SIZE = 8192;
 
-        protected internal readonly DirectoryInfo Directory_Renamed; // The underlying filesystem
directory
+        protected internal readonly DirectoryInfo directory; // The underlying filesystem
directory
         protected internal readonly ISet<string> StaleFiles = new HashSet<string>();
// Files written, but not yet sync'ed
         private int ChunkSize = DEFAULT_READ_CHUNK_SIZE;
 
@@ -133,7 +133,7 @@ namespace Lucene.Net.Store
             return file;
         }
 
-        public FSDirectory(DirectoryInfo dir)
+        protected FSDirectory(DirectoryInfo dir)
             : this(dir, null)
         {
         }
@@ -151,7 +151,7 @@ namespace Lucene.Net.Store
             {
                 lockFactory = new NativeFSLockFactory();
             }
-            Directory_Renamed = GetCanonicalPath(path);
+            directory = GetCanonicalPath(path);
 
             if (File.Exists(path.FullName))
             {
@@ -226,10 +226,10 @@ namespace Lucene.Net.Store
                     // if the lock factory has no lockDir set, use the this directory as
lockDir
                     if (dir == null)
                     {
-                        lf.LockDir = Directory_Renamed;
+                        lf.LockDir = directory;
                         lf.LockPrefix = null;
                     }
-                    else if (dir.FullName.Equals(Directory_Renamed.FullName))
+                    else if (dir.FullName.Equals(directory.FullName))
                     {
                         lf.LockPrefix = null;
                     }
@@ -296,7 +296,7 @@ namespace Lucene.Net.Store
         public override string[] ListAll()
         {
             EnsureOpen();
-            return ListAll(Directory_Renamed);
+            return ListAll(directory);
         }
 
         /// <summary>
@@ -304,7 +304,7 @@ namespace Lucene.Net.Store
         public override bool FileExists(string name)
         {
             EnsureOpen();
-            return File.Exists(Path.Combine(Directory_Renamed.FullName, name));
+            return File.Exists(Path.Combine(directory.FullName, name));
         }
 
         /// <summary>
@@ -312,7 +312,7 @@ namespace Lucene.Net.Store
         public override long FileLength(string name)
         {
             EnsureOpen();
-            FileInfo file = new FileInfo(Path.Combine(Directory_Renamed.FullName, name));
+            FileInfo file = new FileInfo(Path.Combine(directory.FullName, name));
             long len = file.Length;
             if (len == 0 && !file.Exists)
             {
@@ -329,7 +329,7 @@ namespace Lucene.Net.Store
         public override void DeleteFile(string name)
         {
             EnsureOpen();
-            FileInfo file = new FileInfo(Path.Combine(Directory_Renamed.FullName, name));
+            FileInfo file = new FileInfo(Path.Combine(directory.FullName, name));
             try
             {
                 file.Delete();
@@ -353,19 +353,19 @@ namespace Lucene.Net.Store
 
         protected internal virtual void EnsureCanWrite(string name)
         {
-            if (!Directory_Renamed.Exists)
+            if (!directory.Exists)
             {
                 try
                 {
-                    Directory_Renamed.Create();
+                    directory.Create();
                 }
                 catch
                 {
-                    throw new System.IO.IOException("Cannot create directory: " + Directory_Renamed);
+                    throw new System.IO.IOException("Cannot create directory: " + directory);
                 }
             }
 
-            FileInfo file = new FileInfo(Path.Combine(Directory_Renamed.FullName, name));
+            FileInfo file = new FileInfo(Path.Combine(directory.FullName, name));
             if (file.Exists) // delete existing, if any
             {
                 try
@@ -390,7 +390,7 @@ namespace Lucene.Net.Store
             ISet<string> toSync = new HashSet<string>(names);
             toSync.IntersectWith(StaleFiles);
 
-            foreach (string name in toSync)
+            foreach (var name in toSync)
             {
                 Fsync(name);
             }
@@ -399,7 +399,7 @@ namespace Lucene.Net.Store
             // (otherwise it can happen that the directory does not yet exist)!
             if (toSync.Count > 0)
             {
-                IOUtils.Fsync(Directory_Renamed.FullName, true);
+                IOUtils.Fsync(directory.FullName, true);
             }
 
             StaleFiles.ExceptWith(toSync);
@@ -413,7 +413,7 @@ namespace Lucene.Net.Store
                 string dirName; // name to be hashed
                 try
                 {
-                    dirName = Directory_Renamed.FullName;
+                    dirName = directory.FullName;
                 }
                 catch (System.IO.IOException e)
                 {
@@ -446,7 +446,7 @@ namespace Lucene.Net.Store
             get
             {
                 EnsureOpen();
-                return Directory_Renamed;
+                return directory;
             }
         }
 
@@ -454,7 +454,7 @@ namespace Lucene.Net.Store
         /// For debug output. </summary>
         public override string ToString()
         {
-            return this.GetType().Name + "@" + Directory_Renamed + " lockFactory=" + LockFactory;
+            return this.GetType().Name + "@" + directory + " lockFactory=" + LockFactory;
         }
 
         /// <summary>
@@ -495,7 +495,7 @@ namespace Lucene.Net.Store
             {
                 this.Parent = parent;
                 this.Name = name;
-                File = new FileStream(Path.Combine(parent.Directory_Renamed.FullName, name),
FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read);
+                File = new FileStream(Path.Combine(parent.directory.FullName, name), FileMode.OpenOrCreate,
FileAccess.ReadWrite, FileShare.Read);
                 IsOpen = true;
             }
 
@@ -555,7 +555,7 @@ namespace Lucene.Net.Store
         /// <param name="name"></param>
         protected void Fsync(String name, bool isDir = false)
         {
-            IOUtils.Fsync(Path.Combine(Directory_Renamed.FullName, name), false);       
    
+            IOUtils.Fsync(Path.Combine(directory.FullName, name), false);            
         }
     }
 }
\ No newline at end of file


Mime
View raw message