private void cleanupBrokenData() {
    close(true);

    //noinspection TestOnlyProblems
    final File currentDataDir = getCurrentDataDir();
    final File currentDataContextDir = getCurrentDataContextDir();
    final File[] files = currentDataDir.listFiles();
    if (files != null) {
      for (File file : files) {
        if (!FileUtil.filesEqual(file, currentDataContextDir)) {
          FileUtil.delete(file);
        }
      }
    }
    else {
      FileUtil.delete(currentDataDir);
    }
  }
private void cleanupBrokenData()