lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccurr...@apache.org
Subject svn commit: r1369096 - /incubator/lucene.net/trunk/test/core/Util/Paths.cs
Date Fri, 03 Aug 2012 17:00:30 GMT
Author: ccurrens
Date: Fri Aug  3 17:00:30 2012
New Revision: 1369096

URL: http://svn.apache.org/viewvc?rev=1369096&view=rev
Log:
Fixed build broken due to file path issues.

Modified:
    incubator/lucene.net/trunk/test/core/Util/Paths.cs

Modified: incubator/lucene.net/trunk/test/core/Util/Paths.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Util/Paths.cs?rev=1369096&r1=1369095&r2=1369096&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Util/Paths.cs (original)
+++ incubator/lucene.net/trunk/test/core/Util/Paths.cs Fri Aug  3 17:00:30 2012
@@ -101,15 +101,10 @@ namespace Lucene.Net.Util
             {
                 if (s_assemblyDirectory == null)
                 {
-                    s_assemblyDirectory = typeof(Paths).Assembly.CodeBase;
-
-                    // CodeBase uses unc path, get rid of the file prefix if it exists. 

-                    if (s_assemblyDirectory.StartsWith("file://")) {
-                        s_assemblyDirectory = s_assemblyDirectory.Substring(7);
-                    }
-
-                    // ensure that we're only getting the directory.
-                    s_assemblyDirectory = Path.GetDirectoryName(s_assemblyDirectory);
+                    // CodeBase uses unc path, get rid of the file prefix if it exists.
+                    // File prefix could be file:// or file:///
+                    var assemblyDirectoryUri = new Uri(typeof(Paths).Assembly.CodeBase);
+                    s_assemblyDirectory = Path.GetDirectoryName(assemblyDirectoryUri.LocalPath);
                 }
                 return s_assemblyDirectory;
             }



Mime
View raw message