LevelDB implements AutoCloseable { public static void repair(String levelDBDirectory, LevelDBOptions options) { options.checkOptionsOpen(); PointerByReference error = new PointerByReference(); LevelDBNative.leveldb_repair_db(options.options, levelDBDirectory, error); LevelDBNative.checkError(error); } LevelDB(String levelDBDirectory, LevelDBOptions options); void close(); byte[] get(byte[] key, LevelDBReadOptions readOptions); void put(byte[] key, byte[] value, LevelDBWriteOptions writeOptions); void write(LevelDBWriteBatch writeBatch, LevelDBWriteOptions writeOptions); void delete(byte[] key, LevelDBWriteOptions writeOptions); String property(String property); long[] approximateSizes(Range ...ranges); void compactRange(byte[] startKey, byte[] limitKey); static void repair(String levelDBDirectory, LevelDBOptions options); static void destroy(String levelDBDirectory, LevelDBOptions options); static int majorVersion(); static int minorVersion();  }
@Test public void repair_not_esists_database() { try(LevelDBOptions options = new LevelDBOptions()) { LevelDB.repair(testFolder.getRoot().getAbsolutePath(), options); } }