private static void makeBestEffortToCleanStorage(@Nullable Object storage,
                                                   @NotNull Path storageFile) {
    if (storage instanceof CleanableStorage) {
      try {
        ((CleanableStorage)storage).closeAndClean();
      }
      catch (Throwable t) {
        LOG.info(storage.getClass().getSimpleName() + ".closeAndClean() fails: " +
                 t.getClass().getSimpleName() + "(" + ExceptionUtil.getNonEmptyMessage(t, "<no error message given>") + ")");
      }
    }
    else {
      LOG.info("[" + storageFile.getFileName() + "]: " + storage + " is not CleanableStorage " +
               "-> trying to clean by explicitly removing all the files [" + storageFile.getFileName() + "*]");
    }
    //If storage fails to open -- we can't use storage to closeAndClean() its on-disk data, because the storage=null.
    // In a perfect world we should setup each storage to clean-if-not-successfully-open -- in a real world we
    // can't be sure all of the storages follow that rule.
    // And if some storage does not follow, it creates infinite cycle: trying to open VFS -> fail -> trying
    // to clean -> fail to clean some storage(s) -> trying to open fresh -> fail again as some storage(s) wasn't
    // cleaned -> repeat.
    //So this branch is still useful to prevent such a cycle.
    boolean noSuchFilesRemains = IOUtil.deleteAllFilesStartingWith(storageFile);
    if (!noSuchFilesRemains) {
      LOG.info("Can't delete " + storageFile + "*");
    }
  }
private static void makeBestEffortToCleanStorage(@Nullable Object storage,
                                                   @NotNull Path storageFile)