public Config getConfig()

in src/main/java/com/googlesource/gerrit/plugins/gitiles/GerritGitilesAccess.java [179:198]


  public Config getConfig() throws IOException {
    // Try to get a gitiles.config file from the refs/meta/config branch
    // of the project. For non-project access, use All-Projects as project.
    // If none of the above exists, use global gitiles.config.
    Project.NameKey nameKey = Resolver.getNameKey(req);
    Optional<ProjectState> state = projectCache.get(nameKey);
    if (state.isPresent()) {
      Config cfg = state.get().getConfig("gitiles.config").getWithInheritance();
      if (cfg != null && cfg.getSections().size() > 0) {
        return cfg;
      }
    } else {
      Config cfg = projectCache.getAllProjects().getConfig("gitiles.config").get();
      if (cfg != null && cfg.getSections().size() > 0) {
        return cfg;
      }
    }

    return getGlobalConfig();
  }