예제 #1
3
  protected boolean getShowLinearCurve() throws IOException {
    boolean res = false;

    {
      ConfigFactory f = DefaultConfigFactory.getInstance();
      Config c = f.getConfig();

      String configNameLinearCurve = getConfigNameLinearCurve();
      boolean configValueDefault = false;

      // Set 'configValueDefault':
      {
        String mode = c.getProperty("mode");
        if (mode != null) {
          if ("Test".equals(mode)) {
            configValueDefault = true;
          }
        }
      }

      res = c.getPropertyAsBoolean(configNameLinearCurve, configValueDefault);
    }

    return res;
  }
예제 #2
0
  protected List<String> getUserRolesFromConfig(String property) throws IOException {
    List<String> res = null;

    {
      if (property != null) {
        ConfigFactory f = DefaultConfigFactory.getInstance();
        Config c = f.getConfig();

        String v = c.getProperty(property); // re-read; marks property read in 'Config'-impl. cache

        res = parseStringList(v);
      }
    }

    return res;
  }
예제 #3
0
  protected String getUserPresentationNameFromConfig(Principal userPrincipal) throws IOException {
    String res = null;

    {
      if (userPrincipal != null) {
        String userName = PrincipalUtil.getNameStripped(userPrincipal);

        if (userName != null) {
          String property = "security.authorization.user." + userName + ".presentation-name";

          ConfigFactory f = DefaultConfigFactory.getInstance();
          Config c = f.getConfig();

          res = c.getProperty(property);
        }
      }
    }

    return res;
  }