Was.OrcSearch – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | using System; |
2 | using System.IO; |
||
3 | using System.Reflection; |
||
4 | |||
5 | namespace Was.OrcSearch.Helpers |
||
6 | { |
||
7 | public static class PathHelper |
||
8 | { |
||
9 | public static string GetRootDirectory() |
||
10 | { |
||
11 | var codeBase = Assembly.GetExecutingAssembly().CodeBase; |
||
12 | var uri = new UriBuilder(codeBase); |
||
13 | var path = Uri.UnescapeDataString(uri.Path); |
||
14 | |||
15 | var directory = Path.GetDirectoryName(path); |
||
16 | |||
17 | directory = Path.Combine(directory, "search"); |
||
18 | |||
19 | if (!Directory.Exists(directory)) Directory.CreateDirectory(directory); |
||
20 | |||
21 | return directory; |
||
22 | } |
||
23 | } |
||
24 | } |