示例#1
0
 /**
  * Forcibly shuts down readers and writers for a db and removes the results path
  *
  * @param db Database name
  */
 protected void abort(String db) {
   File path = indexPath(db);
   IndexWriter writer = writers.get(db);
   try {
     if (writer != null) writer.close();
   } catch (IOException e) {
   }
   memedb.utils.FileUtils.deleteRecursive(path);
 }
示例#2
0
 public void onDatabaseDeleted(String db, long seq) {
   this.abort(db);
   File path = this.indexPath(db);
   memedb.utils.FileUtils.deleteRecursive(path);
 }
示例#3
0
 /**
  * Returns the base path for the indexing results for the database specified
  *
  * @param db Database name, unencoded
  * @return new File object
  */
 protected File indexPath(String db) {
   return new File(stateDir, memedb.utils.FileUtils.fsEncode(db));
 }