コード例 #1
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     Console.Out.WriteLine("OWL Log in: " + System.Environment.GetFolderPath(Environment.SpecialFolder.Personal));
     Log.Initialize(System.Environment.GetFolderPath(Environment.SpecialFolder.Personal), "Owl", LogLevel.Debug, true);
     Logger.Log.Info("Application Startup");
     Infos.LogPath = Log.LogPath;
     //clearing lock (if app has been abruptly put down)
     Lucene.Net.Store.FSDirectory d = Lucene.Net.Store.FSDirectory.GetDirectory(Owl.Properties.Settings.Default.IndexPath);
     if (d.FileExists(IndexWriter.WRITE_LOCK_NAME))
     {
         Logger.Log.Info("Owl last indexing has been abruptly shut down: now clearing lock.");
         d.ClearLock(IndexWriter.WRITE_LOCK_NAME);
     }
 }
コード例 #2
0
 public override bool FileExists(System.String name)
 {
     return(fsDir.FileExists(name));
 }