/** * 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); }
public void onDatabaseDeleted(String db, long seq) { this.abort(db); File path = this.indexPath(db); memedb.utils.FileUtils.deleteRecursive(path); }
/** * 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)); }