public static <T> T tryOrThrow(Callable<? extends T> actionToTry, Object details) throws RepoStateException {
    IOException cause = null;
    for (int i = 0; i < IO_RETRIES; i++) {
      try {
        return actionToTry.call();
      }
      catch (IOException e) {
        LOG.info("IOException while loading " + details, e);
        cause = e;
      }
      catch (Exception e) {    // this shouldn't happen since only IOExceptions are thrown in clients.
        throw new RepoStateException("Couldn't load file " + details, e);
      }
    }
    throw new RepoStateException("Couldn't load file " + details, cause);
  }
public static <T> T tryOrThrow(Callable<? extends T> actionToTry, Object details)